From: Ian Jackson Date: Sun, 4 Feb 2024 12:36:48 +0000 (+0000) Subject: Use matches! X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=009510029ba6cb7799fd3f6cc4e89ec87a25e9ee;p=mastodonochrome.git Use matches! --- diff --git a/src/activity_stack.rs b/src/activity_stack.rs index e040fd2..6fd4e0d 100644 --- a/src/activity_stack.rs +++ b/src/activity_stack.rs @@ -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(_)) } } diff --git a/src/login.rs b/src/login.rs index d8e6136..ab64a2f 100644 --- a/src/login.rs +++ b/src/login.rs @@ -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 {