diff --git a/common/src/comp/inventory/mod.rs b/common/src/comp/inventory/mod.rs index 2fd8569697..321fc201b9 100644 --- a/common/src/comp/inventory/mod.rs +++ b/common/src/comp/inventory/mod.rs @@ -60,7 +60,7 @@ impl Inventory { } /// Add a series of items to an inventory without giving duplicates. (n * m complexity) - /// + /// /// Error if inventory cannot contain the items (is full), returning the un-added items. /// This is a lazy inefficient implementation, as it iterates over the inventory more times /// than necessary (n^2) and with the proper structure wouldn't need to iterate at all, but because @@ -98,10 +98,7 @@ impl Inventory { /// O(n) count the number of items in this inventory. pub fn count(&self) -> usize { - self.slots - .iter() - .filter_map(|slot| slot.as_ref()) - .count() + self.slots.iter().filter_map(|slot| slot.as_ref()).count() } /// O(n) check if an item is in this inventory. diff --git a/common/src/comp/inventory/test.rs b/common/src/comp/inventory/test.rs index b0f7828a96..51abc2db73 100644 --- a/common/src/comp/inventory/test.rs +++ b/common/src/comp/inventory/test.rs @@ -1,4 +1,3 @@ - use super::*; use lazy_static::lazy_static; lazy_static! { @@ -44,9 +43,7 @@ fn push_unique_all_full() { slots: TEST_ITEMS.iter().map(|a| Some(a.clone())).collect(), }; inv.push_all_unique(TEST_ITEMS.iter().map(|a| a.clone())) - .expect( - "Pushing unique items into an inventory that already contains them didn't work!", - ); + .expect("Pushing unique items into an inventory that already contains them didn't work!"); } /// Attempting to push uniquely into an inventory containing all the items should work fine. @@ -67,6 +64,6 @@ fn push_all_unique_empty() { }; inv.push_all_unique(TEST_ITEMS.iter().map(|a| a.clone())) .expect( - "Pushing unique items into an empty inventory that didn't contain them didn't work!", - ); + "Pushing unique items into an empty inventory that didn't contain them didn't work!", + ); } diff --git a/server/src/cmd.rs b/server/src/cmd.rs index e4ccd21250..5171d5c536 100644 --- a/server/src/cmd.rs +++ b/server/src/cmd.rs @@ -997,12 +997,7 @@ fn handle_exp(server: &mut Server, entity: EcsEntity, args: String, action: &Cha } use common::comp::Item; -fn handle_debug( - server: &mut Server, - entity: EcsEntity, - _args: String, - _action: &ChatCommand, -) { +fn handle_debug(server: &mut Server, entity: EcsEntity, _args: String, _action: &ChatCommand) { if let Ok(items) = assets::load_glob::("common.items.debug.*") { server .state()