Skip to content

Commit

Permalink
review: use matches! macro
Browse files Browse the repository at this point in the history
  • Loading branch information
BillCarsonFr committed Dec 2, 2024
1 parent 5173b5a commit e6258d9
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions crates/matrix-sdk-common/src/deserialized_responses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -736,12 +736,9 @@ impl UnableToDecryptReason {
/// Returns true if this UTD is due to a missing room key (and hence might
/// resolve itself if we wait a bit.)
pub fn is_missing_room_key(&self) -> bool {
match self {
// Return true only if the key is not withheld on purpose.
Self::MissingMegolmSession(None) => true,
Self::UnknownMegolmMessageIndex => true,
_ => false,
}
// In case of MissingMegolmSession with a withheld code we return false here given that
// this API is used to decide if waiting a bit will help.
matches!(self, Self::MissingMegolmSession(None) | Self::UnknownMegolmMessageIndex)
}
}

Expand Down

0 comments on commit e6258d9

Please sign in to comment.