aboutsummaryrefslogtreecommitdiff
path: root/server/src/entity/campaign.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-12-23 12:41:15 +0100
committermetamuffin <metamuffin@disroot.org>2024-12-23 12:41:15 +0100
commit464ebd6fa686d32a16aaa6bd27d8f445caa42f6a (patch)
tree22587801553e44c6d707ca1fac8f3da864ed6ea8 /server/src/entity/campaign.rs
parent6ddb571e02dc04b1125669135eab5731523e8f73 (diff)
downloadhurrycurry-464ebd6fa686d32a16aaa6bd27d8f445caa42f6a.tar
hurrycurry-464ebd6fa686d32a16aaa6bd27d8f445caa42f6a.tar.bz2
hurrycurry-464ebd6fa686d32a16aaa6bd27d8f445caa42f6a.tar.zst
clippy: mostly map_or replaced with is_some_and
Diffstat (limited to 'server/src/entity/campaign.rs')
-rw-r--r--server/src/entity/campaign.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/src/entity/campaign.rs b/server/src/entity/campaign.rs
index 39926a12..7f07be48 100644
--- a/server/src/entity/campaign.rs
+++ b/server/src/entity/campaign.rs
@@ -99,9 +99,9 @@ impl GateCondition {
match self {
GateCondition::All(cs) => cs.iter().all(|c| c.check(scoreboard)),
GateCondition::Any(cs) => cs.iter().any(|c| c.check(scoreboard)),
- GateCondition::Stars(map, thres) => scoreboard.get(map).map_or(false, |s| {
- s.best.first().map_or(false, |b| b.score.stars >= *thres)
- }),
+ GateCondition::Stars(map, thres) => scoreboard
+ .get(map)
+ .is_some_and(|s| s.best.first().is_some_and(|b| b.score.stars >= *thres)),
}
}
pub fn show(&self, scoreboard: &ScoreboardStore) -> Message {