@@ -316,16 +316,16 @@ is an `Err`, the `Err` will be returned from the whole function as if we had
316
316
used the ` return ` keyword so the error value gets propagated to the calling
317
317
code.
318
318
319
- There is a difference between what the ` match ` expression from Listing 9-6 and
320
- the ` ? ` operator do : error values that have the ` ? ` operator called on them go
321
- through the ` from ` function, defined in the ` From ` trait in the standard
322
- library, which is used to convert errors from one type into another. When the
323
- ` ? ` operator calls the ` from ` function, the error type received is converted
324
- into the error type defined in the return type of the current function. This is
325
- useful when a function returns one error type to represent all the ways a
326
- function might fail, even if parts might fail for many different reasons. As
327
- long as each error type implements the ` from ` function to define how to convert
328
- itself to the returned error type, the ` ? ` operator takes care of the
319
+ There is a difference between what the ` match ` expression from Listing 9-6 does
320
+ and what the ` ? ` operator does : error values that have the ` ? ` operator called
321
+ on them go through the ` from ` function, defined in the ` From ` trait in the
322
+ standard library, which is used to convert errors from one type into another.
323
+ When the ` ? ` operator calls the ` from ` function, the error type received is
324
+ converted into the error type defined in the return type of the current
325
+ function. This is useful when a function returns one error type to represent all
326
+ the ways a function might fail, even if parts might fail for many different
327
+ reasons. As long as each error type implements the ` from ` function to define how
328
+ to convert itself to the returned error type, the ` ? ` operator takes care of the
329
329
conversion automatically.
330
330
331
331
In the context of Listing 9-7, the ` ? ` at the end of the ` File::open ` call will
0 commit comments