diff options
Diffstat (limited to 'server/src/commands.rs')
-rw-r--r-- | server/src/commands.rs | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/server/src/commands.rs b/server/src/commands.rs index 86a3de15..24752cc5 100644 --- a/server/src/commands.rs +++ b/server/src/commands.rs @@ -332,15 +332,10 @@ impl Server { .get_item_by_name(&item) .ok_or(tre!("s.error.item_not_found", s = item))?; #[cfg(not(test))] // TODO rust-analyser does not undestand trait upcasting - if self - .entities - .iter() - .find(|e| { - <dyn std::any::Any>::downcast_ref::<Tutorial>(e.as_ref()) - .map_or(false, |t| t.player == player) - }) - .is_some() - { + if self.entities.iter().any(|e| { + <dyn std::any::Any>::downcast_ref::<Tutorial>(e.as_ref()) + .map_or(false, |t| t.player == player) + }) { return Err(tre!("s.error.tutorial_already_running")); } self.entities.push(Box::new(Tutorial::new(player, item))); @@ -365,7 +360,7 @@ impl Server { player, message: Some(Message::Translation { id: message_id, - params: arguments.into_iter().map(|c| Message::Text(c)).collect(), + params: arguments.into_iter().map(Message::Text).collect(), }), timeout: None, }); |