diff options
author | metamuffin <metamuffin@disroot.org> | 2024-11-24 17:18:01 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-11-24 17:18:11 +0100 |
commit | 696dbdd2238e919bffa756fff1f02ace90a81ecb (patch) | |
tree | 305e03ce4fea3c3ee151c7560414b0e2625264ba /server/src/commands.rs | |
parent | 95d14ada0c98fb8f2285fd0003000b5a517f9267 (diff) | |
download | hurrycurry-696dbdd2238e919bffa756fff1f02ace90a81ecb.tar hurrycurry-696dbdd2238e919bffa756fff1f02ace90a81ecb.tar.bz2 hurrycurry-696dbdd2238e919bffa756fff1f02ace90a81ecb.tar.zst |
Manual clippy
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, }); |