diff options
Diffstat (limited to 'error_handling')
| -rw-r--r-- | error_handling/errors1.rs | 1 | ||||
| -rw-r--r-- | error_handling/errors2.rs | 1 | ||||
| -rw-r--r-- | error_handling/errors3.rs | 1 | ||||
| -rw-r--r-- | error_handling/errorsn.rs | 1 | ||||
| -rw-r--r-- | error_handling/option1.rs | 1 | ||||
| -rw-r--r-- | error_handling/result1.rs | 1 |
6 files changed, 6 insertions, 0 deletions
diff --git a/error_handling/errors1.rs b/error_handling/errors1.rs index 843e620..14ed574 100644 --- a/error_handling/errors1.rs +++ b/error_handling/errors1.rs @@ -1,3 +1,4 @@ +// errors1.rs // This function refuses to generate text to be printed on a nametag if // you pass it an empty string. It'd be nicer if it explained what the problem // was, instead of just sometimes returning `None`. The 2nd test currently diff --git a/error_handling/errors2.rs b/error_handling/errors2.rs index a9cb940..05824c1 100644 --- a/error_handling/errors2.rs +++ b/error_handling/errors2.rs @@ -1,3 +1,4 @@ +// errors2.rs // Say we're writing a game where you can buy items with tokens. All items cost // 5 tokens, and whenever you purchase items there is a processing fee of 1 // token. A player of the game will type in how many items they want to buy, diff --git a/error_handling/errors3.rs b/error_handling/errors3.rs index 3ecffbc..9b285e0 100644 --- a/error_handling/errors3.rs +++ b/error_handling/errors3.rs @@ -1,3 +1,4 @@ +// errors3.rs // This is a program that is trying to use a completed version of the // `total_cost` function from the previous exercise. It's not working though-- // we can't call the `try!` macro in the `main()` function! Why not? diff --git a/error_handling/errorsn.rs b/error_handling/errorsn.rs index e0d73da..4fb2be3 100644 --- a/error_handling/errorsn.rs +++ b/error_handling/errorsn.rs @@ -1,3 +1,4 @@ +// errorsn.rs // This is a bigger error exercise than the previous ones! // You can do it! // diff --git a/error_handling/option1.rs b/error_handling/option1.rs index 5f96184..9cf0bc9 100644 --- a/error_handling/option1.rs +++ b/error_handling/option1.rs @@ -1,3 +1,4 @@ +// option1.rs // This example panics because the second time it calls `pop`, the `vec` // is empty, so `pop` returns `None`, and `unwrap` panics if it's called // on `None`. Handle this in a more graceful way than calling `unwrap`! diff --git a/error_handling/result1.rs b/error_handling/result1.rs index 7146d1e..851ab45 100644 --- a/error_handling/result1.rs +++ b/error_handling/result1.rs @@ -1,3 +1,4 @@ +// result1.rs // Make this test pass! Scroll down for hints :) #[derive(PartialEq,Debug)] |
