mirror of https://github.com/rust-lang/book
Update snapshot for chapter 12
This commit is contained in:
parent
58df14a268
commit
4efdde8b99
|
@ -1,3 +1,8 @@
|
|||
<!-- DO NOT EDIT THIS FILE.
|
||||
|
||||
This file is periodically generated from the content in the `/src/`
|
||||
directory, so all fixes need to be made in `/src/`.
|
||||
-->
|
||||
|
||||
[TOC]
|
||||
|
||||
|
@ -37,6 +42,7 @@ Our `grep` project will combine a number of concepts you’ve learned so far:
|
|||
* Handling errors (Chapter 9)
|
||||
* Using traits and lifetimes where appropriate (Chapter 10)
|
||||
* Writing tests (Chapter 11)
|
||||
|
||||
We’ll also briefly introduce closures, iterators, and trait objects, which
|
||||
Chapters 13 and 17 will cover in detail.
|
||||
|
||||
|
@ -347,6 +353,7 @@ should be limited to the following:
|
|||
* Setting up any other configuration
|
||||
* Calling a `run` function in *lib.rs*
|
||||
* Handling the error if `run` returns an error
|
||||
|
||||
This pattern is about separating concerns: *main.rs* handles running the
|
||||
program, and *lib.rs* handles all the logic of the task at hand. Because you
|
||||
can’t test the `main` function directly, this structure lets you test all of
|
||||
|
@ -1626,7 +1633,6 @@ fn main() {
|
|||
|
||||
if let Err(e) = minigrep::run(config) {
|
||||
eprintln!("Application error: {e}");
|
||||
|
||||
process::exit(1);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue