Add track_caller attribute to Result::unwrap_or_else

This commit is contained in:
ravenclaw900 2023-10-01 09:42:37 -05:00
parent c16823d757
commit ba0b7f0f01
No known key found for this signature in database
GPG Key ID: BB7D044236B5E82C

View File

@ -1422,6 +1422,7 @@ pub fn unwrap_or(self, default: T) -> T {
/// assert_eq!(Err("foo").unwrap_or_else(count), 3);
/// ```
#[inline]
#[track_caller]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn unwrap_or_else<F: FnOnce(E) -> T>(self, op: F) -> T {
match self {