Skip to content

Commit 947add3

Browse files
committed
Add #[must_use] annotation to Result::ok
1 parent b9ea82b commit 947add3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/core/src/result.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,7 @@ impl<T, E> Result<T, E> {
655655
#[inline]
656656
#[stable(feature = "rust1", since = "1.0.0")]
657657
#[rustc_diagnostic_item = "result_ok_method"]
658+
#[must_use]
658659
pub fn ok(self) -> Option<T> {
659660
match self {
660661
Ok(x) => Some(x),

0 commit comments

Comments
 (0)