Closed
Description
The "Error Handling" section of the book has a code example error under the "Adding Functionality" section: https://doc.rust-lang.org/book/error-handling.html#adding-functionality
the second code example shows the use of a macro named "fatal!" which does not exist:
match search(&args.arg_data_path, &args.arg_city) {
Err(CliError::NotFound) if args.flag_quiet => process::exit(1),
Err(err) => fatal!("{}", err),
Ok(pops) => for pop in pops {
println!("{}, {}: {:?}", pop.city, pop.country, pop.count);
}
}
and (on a much more minor scale) the code sample directly above has a misspelling of the word "quiet" as "quit":
opts.optflag("q", "quit", "Silences errors and warnings.");
Metadata
Metadata
Assignees
Labels
No labels