From 871ebab8df4cb10714512316d58cb305170d84cf Mon Sep 17 00:00:00 2001 From: aaaxx Date: Sat, 7 Jan 2017 06:18:06 +0100 Subject: [PATCH 1/3] Update ch09-02-recoverable-errors-with-result.md --- src/ch09-02-recoverable-errors-with-result.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ch09-02-recoverable-errors-with-result.md b/src/ch09-02-recoverable-errors-with-result.md index e3013105b..8ebbf9e47 100644 --- a/src/ch09-02-recoverable-errors-with-result.md +++ b/src/ch09-02-recoverable-errors-with-result.md @@ -392,7 +392,7 @@ io::Error>`. This means that the function is returning a value of the type `Result` where the generic parameter `T` has been filled in with the concrete type `String`, and the generic type `E` has been filled in with the concrete type `io::Error`. If this function succeeds without any problems, the -caller of this function will receive an `Ok` value that holds a `String` -- the +caller of this function will receive an `Ok` value that holds a `String`—the username that this function read from the file. If this function encounters any problems, the caller of this function will receive an `Err` value that holds an instance of `io::Error` that contains more information about what the problems From c88e602b7b6882598a1778d1816d81bfe0e88eb3 Mon Sep 17 00:00:00 2001 From: aaaxx Date: Sat, 7 Jan 2017 06:27:03 +0100 Subject: [PATCH 2/3] Update ch09-03-to-panic-or-not-to-panic.md --- src/ch09-03-to-panic-or-not-to-panic.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ch09-03-to-panic-or-not-to-panic.md b/src/ch09-03-to-panic-or-not-to-panic.md index c964c8c65..c15a1656d 100644 --- a/src/ch09-03-to-panic-or-not-to-panic.md +++ b/src/ch09-03-to-panic-or-not-to-panic.md @@ -73,9 +73,9 @@ we'd definitely want to handle the `Result` in a more robust way instead. ### Guidelines for Error Handling It's advisable to have your code `panic!` when it's possible that you could end -up in a *bad state*---in this context, *bad state* is when some assumption, +up in a *bad state*—in this context, *bad state* is when some assumption, guarantee, contract, or invariant has been broken, such as when invalid values, -contradictory values, or missing values are passed to your code---plus one or +contradictory values, or missing values are passed to your code—plus one or more of the following: * The bad state is not something that's *expected* to happen occasionally From 61e9710d8527b4e1b0eb20197d4290f925a3e058 Mon Sep 17 00:00:00 2001 From: aaaxx Date: Sat, 7 Jan 2017 06:43:42 +0100 Subject: [PATCH 3/3] Update ch10-03-lifetime-syntax.md --- src/ch10-03-lifetime-syntax.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ch10-03-lifetime-syntax.md b/src/ch10-03-lifetime-syntax.md index c831554e5..435945030 100644 --- a/src/ch10-03-lifetime-syntax.md +++ b/src/ch10-03-lifetime-syntax.md @@ -127,7 +127,7 @@ annotations: Here, we've annotated the lifetime of `r` with `'a` and the lifetime of `x` with `'b`. Rust looks at these lifetimes and sees that `r` has a lifetime of `'a`, but that it refers to something with a lifetime of `'b`. It rejects the -program because the lifetime `'b` is shorter than the lifetime of `'a`-- the +program because the lifetime `'b` is shorter than the lifetime of `'a`—the value that the reference is referring to does not live as long as the reference does.