1
Fork 0

Add #[track_caller] to Option::unwrap_or_else

This commit is contained in:
DaniPopes 2023-10-16 15:16:57 +02:00
parent a00c09e9d8
commit 0df670fb67
No known key found for this signature in database
GPG key ID: 0F09640DDB7AC692

View file

@ -959,6 +959,7 @@ impl<T> Option<T> {
/// assert_eq!(None.unwrap_or_else(|| 2 * k), 20);
/// ```
#[inline]
#[track_caller]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn unwrap_or_else<F>(self, f: F) -> T
where