From f8e6844954542eb0e20e728b2318c1b4ccf8bce9 Mon Sep 17 00:00:00 2001 From: Kazantcev Andrey Date: Mon, 17 Apr 2023 17:55:02 +0300 Subject: [PATCH] Use `matches` by None in `is_none` method on Option --- library/core/src/option.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/option.rs b/library/core/src/option.rs index 057053297cd2d..6490bffc715f0 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -641,7 +641,7 @@ impl Option { #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(feature = "const_option_basics", since = "1.48.0")] pub const fn is_none(&self) -> bool { - !self.is_some() + matches!(*self, None) } /////////////////////////////////////////////////////////////////////////