Skip to content
masterclass Buddy

Rust · Method

Option::unwrap

Option::unwrap extracts the value from Some. It panics when called on None.

Last updated

Since
1.0.0

Syntax

pub fn unwrap(self) -> T

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • Option
  • Option::expect
  • Option::is_some
  • Some
  • None
  • match

Source: Option & unwrap - Rust By Example. Checked 2026-11-03.