O'Reilly logo
  • Ivan Zderadicka thinks this is interesting:

In this simple example, we get the first characters of the Cargo.toml file. As you can see, we are returning std::io::Errors converted into failure::Errors with the ? operator. Then, we can iterate over the errors if they exist. If something goes wrong, this will be the output of the code. We have added some context for each of the potential errors, so that the output gets properly printed:


Cover of Rust High Performance


looks like whole file is read