From bead16bfc729ed491354781f5eb4c19d61eb5782 Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Mon, 13 Mar 2017 13:13:30 +0000 Subject: [PATCH] rebuild pages at af0f132 --- ...h12-03-improving-error-handling-and-modularity.html | 10 +++++----- second-edition/print.html | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/second-edition/ch12-03-improving-error-handling-and-modularity.html b/second-edition/ch12-03-improving-error-handling-and-modularity.html index 0641394c3..fd514c260 100644 --- a/second-edition/ch12-03-improving-error-handling-and-modularity.html +++ b/second-edition/ch12-03-improving-error-handling-and-modularity.html @@ -211,9 +211,9 @@ code very straightforward.

The Tradeoffs of Using clone

There's a tendency amongst many Rustaceans to prefer not to use clone to fix -ownership problems due to its runtime cost. In Chapter XX on iterators, we'll -learn how to make this situation more efficient. For now, it's okay to copy a -few strings to keep making progress. We're only going to be making these +ownership problems due to its runtime cost. In Chapter 13 we'll learn how to +make this situation more efficient with iterators. For now, it's okay to copy +a few strings to keep making progress. We're only going to be making these copies once, and our filename and search string are both very small. It's better to have a working program that's a bit inefficient than try to hyper-optimize code on your first pass. As you get more experienced with Rust, @@ -355,7 +355,7 @@ by the standard library: unwrap_or_else. This method has similar be unwrap if the Result is an Ok value: it returns the inner value Ok is wrapping. Unlike unwrap, if the value is an Err value, this method calls a closure which is an anonymous function that we define and pass as an argument -to unwrap_or_else. We'll be covering closures in more detail in Chapter XX; +to unwrap_or_else. We'll be covering closures in more detail in Chapter 13; the important part to understand in this case is that unwrap_or_else will pass the inner value of the Err to our closure in the parameter err that appears between the vertical pipes. Using unwrap_or_else lets us do some @@ -437,7 +437,7 @@ which we'll be covering in Chapter XX. For now, think of it like this: the Error trait, but we're not specifying what particular type the return value will be. This gives us flexibility to return error values that may be of different types in different error cases. Box is a smart pointer to heap -data, and we'll be going into detail about Box in Chapter YY.

+data, and we'll be going into detail about Box in Chapter 15.

The second change is that we've removed our calls to expect in favor of ?, like we talked about in Chapter 9. Rather than panic! on an error, this will return the error value from the function we're in for the caller to handle.

diff --git a/second-edition/print.html b/second-edition/print.html index cc4c29f02..65afc0e6e 100644 --- a/second-edition/print.html +++ b/second-edition/print.html @@ -10488,9 +10488,9 @@ code very straightforward.

The Tradeoffs of Using clone

There's a tendency amongst many Rustaceans to prefer not to use clone to fix -ownership problems due to its runtime cost. In Chapter XX on iterators, we'll -learn how to make this situation more efficient. For now, it's okay to copy a -few strings to keep making progress. We're only going to be making these +ownership problems due to its runtime cost. In Chapter 13 we'll learn how to +make this situation more efficient with iterators. For now, it's okay to copy +a few strings to keep making progress. We're only going to be making these copies once, and our filename and search string are both very small. It's better to have a working program that's a bit inefficient than try to hyper-optimize code on your first pass. As you get more experienced with Rust, @@ -10632,7 +10632,7 @@ by the standard library: unwrap_or_else. This method has similar be unwrap if the Result is an Ok value: it returns the inner value Ok is wrapping. Unlike unwrap, if the value is an Err value, this method calls a closure which is an anonymous function that we define and pass as an argument -to unwrap_or_else. We'll be covering closures in more detail in Chapter XX; +to unwrap_or_else. We'll be covering closures in more detail in Chapter 13; the important part to understand in this case is that unwrap_or_else will pass the inner value of the Err to our closure in the parameter err that appears between the vertical pipes. Using unwrap_or_else lets us do some @@ -10714,7 +10714,7 @@ which we'll be covering in Chapter XX. For now, think of it like this: the Error trait, but we're not specifying what particular type the return value will be. This gives us flexibility to return error values that may be of different types in different error cases. Box is a smart pointer to heap -data, and we'll be going into detail about Box in Chapter YY.

+data, and we'll be going into detail about Box in Chapter 15.

The second change is that we've removed our calls to expect in favor of ?, like we talked about in Chapter 9. Rather than panic! on an error, this will return the error value from the function we're in for the caller to handle.