chiark / gitweb /
Use matches!
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 4 Feb 2024 12:36:48 +0000 (12:36 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 4 Feb 2024 14:24:30 +0000 (14:24 +0000)
src/activity_stack.rs
src/login.rs

index e040fd20f5df1f02fee23446a25379ce55920ff9..6fd4e0dade49ced473476f1511cd72dfd88030d6 100644 (file)
@@ -97,10 +97,7 @@ impl Activity {
         // This even counts the ReadMentions activity _itself_ - it
         // gets reinitialised, because that's the simplest way to jump
         // you down to the new message.
-        match self {
-            Activity::Compose(_) => false,
-            _ => true,
-        }
+        matches!(self, Activity::Compose(_))
     }
 }
 
index d8e61361cd9b57d0127ae95f892a65257abb71d3..ab64a2f745a0dbcbabd1fd7f4edb220a26d8fd6c 100644 (file)
@@ -146,12 +146,10 @@ impl Password {
     }
 
     fn ok(&self) -> bool {
-        match self.diagnostic() {
-            PasswordDiagnostic::OrigGood | PasswordDiagnostic::ConfirmGood => {
-                true
-            }
-            _ => false,
-        }
+        matches!(
+            self.diagnostic(),
+            PasswordDiagnostic::OrigGood | PasswordDiagnostic::ConfirmGood,
+        )
     }
 }
 impl EditableMenuLineData for Password {