From 464ebd6fa686d32a16aaa6bd27d8f445caa42f6a Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 23 Dec 2024 12:41:15 +0100 Subject: clippy: mostly map_or replaced with is_some_and --- server/bot/src/algos/simple.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'server/bot/src/algos/simple.rs') diff --git a/server/bot/src/algos/simple.rs b/server/bot/src/algos/simple.rs index b275b522..14eb38c4 100644 --- a/server/bot/src/algos/simple.rs +++ b/server/bot/src/algos/simple.rs @@ -109,7 +109,7 @@ impl Context<'_, S> { self.game .players .get(&self.me) - .map_or(false, |p| p.item.as_ref().map_or(false, |i| i.kind == item)) + .is_some_and(|p| p.item.as_ref().is_some_and(|i| i.kind == item)) } pub fn is_hand_occupied(&self) -> bool { self.game @@ -131,7 +131,7 @@ impl Context<'_, S> { self.game .tiles .get(&(pos + *off)) - .map_or(false, |t| self.game.data.tile_interact[t.kind.0]) + .is_some_and(|t| self.game.data.tile_interact[t.kind.0]) }) .map(|off| pos + off) .map(|pos| (*item, pos)) @@ -155,7 +155,7 @@ impl Context<'_, S> { self.game .tiles .get(&(pos + *off)) - .map_or(false, |t| self.game.data.tile_interact[t.kind.0]) + .is_some_and(|t| self.game.data.tile_interact[t.kind.0]) }) .map(|off| pos + off) .map(|pos| (*item, pos)) @@ -177,7 +177,7 @@ impl Context<'_, S> { self.game .tiles .iter() - .find(|(_, t)| t.item.as_ref().map_or(false, |t| t.kind == item)) + .find(|(_, t)| t.item.as_ref().is_some_and(|t| t.kind == item)) .map(|(p, _)| *p) } pub fn find_tile(&self, tile: TileIndex) -> Option { -- cgit v1.2.3-70-g09d2