Skip to content

Commit f8e6844

Browse files
authored
Use matches by None in is_none method on Option
1 parent e49122f commit f8e6844

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/core/src/option.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ impl<T> Option<T> {
641641
#[stable(feature = "rust1", since = "1.0.0")]
642642
#[rustc_const_stable(feature = "const_option_basics", since = "1.48.0")]
643643
pub const fn is_none(&self) -> bool {
644-
!self.is_some()
644+
matches!(*self, None)
645645
}
646646

647647
/////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)