enable manual_is_variant_and lint

This commit is contained in:
Charles Hall 2024-05-21 22:06:45 -07:00
parent 5048af3a8f
commit 41a5e6fb50
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
2 changed files with 4 additions and 6 deletions

View file

@ -72,7 +72,6 @@ wildcard_dependencies = "warn"
missing_errors_doc = "allow"
missing_panics_doc = "allow"
manual_is_variant_and = "allow"
mixed_attributes_style = "allow"
multiple_bound_locations = "allow"
option_as_ref_cloned = "allow"

View file

@ -108,17 +108,16 @@ impl Service {
#[tracing::instrument(skip(self), ret(level = "trace"))]
fn user_was_joined(&self, shortstatehash: u64, user_id: &UserId) -> bool {
self.user_membership(shortstatehash, user_id)
.map(|s| s == MembershipState::Join)
.unwrap_or_default()
.is_ok_and(|s| s == MembershipState::Join)
}
/// The user was an invited or joined room member at this state (potentially
/// in the past)
#[tracing::instrument(skip(self), ret(level = "trace"))]
fn user_was_invited(&self, shortstatehash: u64, user_id: &UserId) -> bool {
self.user_membership(shortstatehash, user_id)
.map(|s| s == MembershipState::Join || s == MembershipState::Invite)
.unwrap_or_default()
self.user_membership(shortstatehash, user_id).is_ok_and(|s| {
s == MembershipState::Join || s == MembershipState::Invite
})
}
/// Whether a server is allowed to see an event through federation, based on