chore: Use .is_some_and(…) instead of .map_or(false, …)

This commit is contained in:
Kévin Commaille
2023-08-14 15:41:15 +02:00
committed by Kévin Commaille
parent b2fe172be1
commit bcae4e5799
6 changed files with 16 additions and 17 deletions

View File

@@ -719,7 +719,7 @@ fn can_send_event(event: impl Event, ple: Option<impl Event>, user_level: Int) -
return false;
}
if event.state_key().map_or(false, |k| k.starts_with('@'))
if event.state_key().is_some_and(|k| k.starts_with('@'))
&& event.state_key() != Some(event.sender().as_str())
{
return false; // permission required to post in this room