chore: Use .is_some_and(…) instead of .map_or(false, …)
This commit is contained in:
committed by
Kévin Commaille
parent
b2fe172be1
commit
bcae4e5799
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user