Skip to content

Commit

Permalink
fixup! push: Add method to insert a user push rule in a Ruleset
Browse files Browse the repository at this point in the history
  • Loading branch information
zecakeh committed Nov 9, 2022
1 parent f6a7a0d commit 7a050b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/ruma-common/src/push.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ impl Ruleset {
if rule_id.contains('\\') {
return Err(InsertPushRuleError::InvalidRuleId);
}
if after.filter(|s| s.starts_with('.')).is_some() {
if after.map_or(false, |s| s.starts_with('.')) {
return Err(InsertPushRuleError::RelativeToServerDefaultRule);
}
if before.filter(|s| s.starts_with('.')).is_some() {
if before.map_or(false, |s| s.starts_with('.')) {
return Err(InsertPushRuleError::RelativeToServerDefaultRule);
}

Expand Down

0 comments on commit 7a050b9

Please sign in to comment.