Skip to content

Glossary: Rust Basics

expect

Also written: expect()

Like `unwrap`, it takes the value out of an `Ok` or `Some`, but if there is none it panics with your own message.

Where the book teaches it

Related terms

unwrapPanic