Errata

Command-Line Rust

Errata for Command-Line Rust

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Page Chapter 1 - Understanding Program Exit Values
Locarion 709 of 19798

```rust
#[test]
fn false_not_ok() {
let mut cmd = Command::cargo_bin("false").unwrap();
cmd.assert().failure();
}
```
This test fails

Note from the Author or Editor:
I cannot see how this test fails for you. It definitely works for me. Are you sure that your "false" program is correctly reporting a nonzero exit value?

Anonymous  Jun 17, 2023 
PDF Page 57
2nd paragraph

"Both a filehandle and std::io::stdin implement the BufRead trait"

In fact, filehandle and std::io::stdin only implement the Read trait.

A BufReader is created subsequently which is implemented for the Read trait. BufReader in turn implements the BufRead trait which provides the BufRead::lines method.

Carsten Klaucke  Mar 10, 2024