concept expect() in category rust

appears as: expect()
Rust in Action

This is an excerpt from Manning's book Rust in Action.

The error handling is relatively ugly, with many calls to unwrap() and expect(). We’ll address that problem shortly during Section 8.5.

8.5.3. Cheat with unwrap() and expect()

The final approach for dealing with multiple error types is to use unwrap() and expect(). This is a reasonable approach when writing a main() function, but isn’t recommended for library authors. Your users don’t want their programs to crash because of things outside of their control.