aboutsummaryrefslogtreecommitdiff
path: root/server/src/entity/tutorial.rs
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/entity/tutorial.rs')
-rw-r--r--server/src/entity/tutorial.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/server/src/entity/tutorial.rs b/server/src/entity/tutorial.rs
index 60b32c79..44244862 100644
--- a/server/src/entity/tutorial.rs
+++ b/server/src/entity/tutorial.rs
@@ -144,7 +144,7 @@ impl StepContext<'_> {
.game
.players
.get(&self.player)
- .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 find_demand(&self, item: ItemIndex) -> Option<IVec2> {
self.ent
@@ -171,7 +171,7 @@ impl StepContext<'_> {
.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)
}
fn find_tile(&self, tile: TileIndex) -> Option<IVec2> {
@@ -195,9 +195,9 @@ impl StepContext<'_> {
}
fn prevent_burning(&self) -> Result<(), (Option<IVec2>, Message)> {
if let Some((pos, tile)) = self.ent.game.tiles.iter().find(|(_, t)| {
- t.item.as_ref().map_or(false, |t| {
- t.active.as_ref().map_or(false, |i| i.warn && i.speed > 0.)
- })
+ t.item
+ .as_ref()
+ .is_some_and(|t| t.active.as_ref().is_some_and(|i| i.warn && i.speed > 0.))
}) {
Err((
Some(*pos),
@@ -228,7 +228,7 @@ impl StepContext<'_> {
.game
.players
.get(&self.player)
- .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))
{
if let Some(pos) = self.find_demand(item) {
Err((Some(pos), trm!("s.tutorial.serve")))