Improve wording for Option and Result
This commit is contained in:
parent
b486fd5d83
commit
e0fd37dcf7
@ -106,11 +106,10 @@
|
|||||||
//!
|
//!
|
||||||
//! *It's much nicer!*
|
//! *It's much nicer!*
|
||||||
//!
|
//!
|
||||||
//! Ending the expression with [`?`] will result in the unwrapped
|
//! Ending the expression with [`?`] will result in the [`Some`]'s unwrapped value, unless the
|
||||||
//! success ([`Some`]) value, unless the result is [`None`], in which case
|
//! result is [`None`], in which case [`None`] is returned early from the enclosing function.
|
||||||
//! [`None`] is returned early from the enclosing function.
|
|
||||||
//!
|
//!
|
||||||
//! [`?`] can only be used in functions that return [`Option`] because of the
|
//! [`?`] can be used in functions that return [`Option`] because of the
|
||||||
//! early return of [`None`] that it provides.
|
//! early return of [`None`] that it provides.
|
||||||
//!
|
//!
|
||||||
//! [`?`]: crate::ops::Try
|
//! [`?`]: crate::ops::Try
|
||||||
|
@ -209,11 +209,10 @@
|
|||||||
//!
|
//!
|
||||||
//! *It's much nicer!*
|
//! *It's much nicer!*
|
||||||
//!
|
//!
|
||||||
//! Ending the expression with [`?`] will result in the unwrapped
|
//! Ending the expression with [`?`] will result in the [`Ok`]'s unwrapped value, unless the result
|
||||||
//! success ([`Ok`]) value, unless the result is [`Err`], in which case
|
//! is [`Err`], in which case [`Err`] is returned early from the enclosing function.
|
||||||
//! [`Err`] is returned early from the enclosing function.
|
|
||||||
//!
|
//!
|
||||||
//! [`?`] can only be used in functions that return [`Result`] because of the
|
//! [`?`] can be used in functions that return [`Result`] because of the
|
||||||
//! early return of [`Err`] that it provides.
|
//! early return of [`Err`] that it provides.
|
||||||
//!
|
//!
|
||||||
//! [`expect`]: Result::expect
|
//! [`expect`]: Result::expect
|
||||||
|
Loading…
Reference in New Issue
Block a user