diff --git a/server/src/sys/subscription.rs b/server/src/sys/subscription.rs index 0d37a2c233..8195cde1eb 100644 --- a/server/src/sys/subscription.rs +++ b/server/src/sys/subscription.rs @@ -38,7 +38,6 @@ impl<'a> System<'a> for Sys { ); #[allow(clippy::block_in_if_condition_stmt)] // TODO: Pending review in #587 - #[allow(clippy::clone_on_copy)] // TODO: Pending review in #587 fn run( &mut self, ( @@ -181,7 +180,7 @@ impl<'a> System<'a> for Sys { ) { // Send client intial info about the entities in this region if it was not // already within the set of subscribed regions - if subscription.regions.insert(key.clone()) { + if subscription.regions.insert(key) { if let Some(region) = region_map.get(key) { for (pos, vel, ori, _, entity) in ( &positions, diff --git a/voxygen/src/audio/mod.rs b/voxygen/src/audio/mod.rs index 9617a8fea8..370c3ec45f 100644 --- a/voxygen/src/audio/mod.rs +++ b/voxygen/src/audio/mod.rs @@ -173,15 +173,14 @@ impl AudioFrontend { } } - #[allow(clippy::clone_on_copy)] // TODO: Pending review in #587 pub fn set_listener_pos(&mut self, pos: &Vec3, ori: &Vec3) { - self.listener_pos = pos.clone(); + self.listener_pos = *pos; self.listener_ori = ori.normalized(); let up = Vec3::new(0.0, 0.0, 1.0); - let pos_left = up.cross(self.listener_ori.clone()).normalized(); - let pos_right = self.listener_ori.cross(up.clone()).normalized(); + let pos_left = up.cross(self.listener_ori).normalized(); + let pos_right = self.listener_ori.cross(up).normalized(); self.listener_ear_left = pos_left; self.listener_ear_right = pos_right; diff --git a/voxygen/src/hud/item_imgs.rs b/voxygen/src/hud/item_imgs.rs index 66f1289e41..3b6434d73a 100644 --- a/voxygen/src/hud/item_imgs.rs +++ b/voxygen/src/hud/item_imgs.rs @@ -28,15 +28,14 @@ pub enum ItemKey { Empty, } impl From<&Item> for ItemKey { - #[allow(clippy::clone_on_copy)] // TODO: Pending review in #587 fn from(item: &Item) -> Self { match &item.kind { - ItemKind::Tool(Tool { kind, .. }) => ItemKey::Tool(kind.clone()), - ItemKind::Lantern(Lantern { kind, .. }) => ItemKey::Lantern(kind.clone()), - ItemKind::Armor { kind, .. } => ItemKey::Armor(kind.clone()), - ItemKind::Utility { kind, .. } => ItemKey::Utility(kind.clone()), - ItemKind::Consumable { kind, .. } => ItemKey::Consumable(kind.clone()), - ItemKind::Ingredient { kind, .. } => ItemKey::Ingredient(kind.clone()), + ItemKind::Tool(Tool { kind, .. }) => ItemKey::Tool(*kind), + ItemKind::Lantern(Lantern { kind, .. }) => ItemKey::Lantern(*kind), + ItemKind::Armor { kind, .. } => ItemKey::Armor(*kind), + ItemKind::Utility { kind, .. } => ItemKey::Utility(*kind), + ItemKind::Consumable { kind, .. } => ItemKey::Consumable(*kind), + ItemKind::Ingredient { kind, .. } => ItemKey::Ingredient(*kind), } } } diff --git a/voxygen/src/menu/char_selection/mod.rs b/voxygen/src/menu/char_selection/mod.rs index 856bf3f467..8d82f7b4f7 100644 --- a/voxygen/src/menu/char_selection/mod.rs +++ b/voxygen/src/menu/char_selection/mod.rs @@ -35,7 +35,6 @@ impl CharSelectionState { } impl PlayState for CharSelectionState { - #[allow(clippy::clone_on_copy)] // TODO: Pending review in #587 fn play(&mut self, _: Direction, global_state: &mut GlobalState) -> PlayStateResult { // Set up an fps clock. let mut clock = Clock::start(); @@ -127,7 +126,7 @@ impl PlayState for CharSelectionState { time: client.state().get_time(), delta_time: client.state().ecs().read_resource::().0, tick: client.get_tick(), - body: humanoid_body.clone(), + body: humanoid_body, gamma: global_state.settings.graphics.gamma, mouse_smoothing: global_state.settings.gameplay.smooth_pan_enable, figure_lod_render_distance: global_state @@ -145,7 +144,7 @@ impl PlayState for CharSelectionState { self.scene.render( global_state.window.renderer_mut(), self.client.borrow().get_tick(), - humanoid_body.clone(), + humanoid_body, loadout.as_ref(), ); diff --git a/voxygen/src/menu/char_selection/ui.rs b/voxygen/src/menu/char_selection/ui.rs index 47209c7301..bd5281d087 100644 --- a/voxygen/src/menu/char_selection/ui.rs +++ b/voxygen/src/menu/char_selection/ui.rs @@ -339,14 +339,13 @@ impl CharSelectionUi { } } - #[allow(clippy::clone_on_copy)] // TODO: Pending review in #587 pub fn get_character_list(&self) -> Option> { match &self.mode { Mode::Select(data) => data.clone(), Mode::Create { name, body, tool, .. } => { - let body = comp::Body::Humanoid(body.clone()); + let body = comp::Body::Humanoid(*body); Some(vec![CharacterItem { character: Character { @@ -398,7 +397,6 @@ impl CharSelectionUi { } // TODO: Split this into multiple modules or functions. - #[allow(clippy::clone_on_copy)] // TODO: Pending review in #587 #[allow(clippy::useless_let_if_seq)] // TODO: Pending review in #587 #[allow(clippy::unnecessary_operation)] // TODO: Pending review in #587 fn update_layout(&mut self, client: &mut Client) -> Vec { @@ -910,7 +908,7 @@ impl CharSelectionUi { events.push(Event::AddCharacter { alias: name.clone(), tool: tool.map(|tool| tool.to_string()), - body: comp::Body::Humanoid(body.clone()), + body: comp::Body::Humanoid(*body), }); to_select = true; diff --git a/voxygen/src/ui/widgets/ghost_image.rs b/voxygen/src/ui/widgets/ghost_image.rs index 272e177b84..8917dba62d 100644 --- a/voxygen/src/ui/widgets/ghost_image.rs +++ b/voxygen/src/ui/widgets/ghost_image.rs @@ -39,8 +39,7 @@ impl Widget for GhostImage { } } - #[allow(clippy::clone_on_copy)] // TODO: Pending review in #587 - fn style(&self) -> Self::Style { self.style.clone() } + fn style(&self) -> Self::Style { self.style } fn update(self, args: widget::UpdateArgs) -> Self::Event { let widget::UpdateArgs { state, .. } = args; diff --git a/world/src/civ/mod.rs b/world/src/civ/mod.rs index d682bb5a85..921607931a 100644 --- a/world/src/civ/mod.rs +++ b/world/src/civ/mod.rs @@ -1041,13 +1041,12 @@ impl MapVec { pub fn get(&self, entry: K) -> &T { self.entries.get(&entry).unwrap_or(&self.default) } - #[allow(clippy::clone_on_copy)] // TODO: Pending review in #587 pub fn map(self, mut f: impl FnMut(K, T) -> U) -> MapVec { MapVec { entries: self .entries .into_iter() - .map(|(s, v)| (s.clone(), f(s, v))) + .map(|(s, v)| (s, f(s, v))) .collect(), default: U::default(), } diff --git a/world/src/util/small_cache.rs b/world/src/util/small_cache.rs index 41d7475f32..2246d5b932 100644 --- a/world/src/util/small_cache.rs +++ b/world/src/util/small_cache.rs @@ -27,7 +27,6 @@ impl Default for SmallCache { } } impl SmallCache { - #[allow(clippy::clone_on_copy)] // TODO: Pending review in #587 pub fn get) -> V>(&mut self, key: Vec2, f: F) -> &V { let idx = calc_idx(key) % CACHE_LEN; @@ -57,7 +56,7 @@ impl SmallCache { for i in 0..4 { let idx = idx + i * i; if self.index[idx].is_none() { - self.index[idx] = Some(key.clone()); + self.index[idx] = Some(key); self.data[idx] = f(key); return &self.data[idx]; } @@ -66,7 +65,7 @@ impl SmallCache { let step = super::seed_expan::diffuse(self.random) as usize % 4; let idx = step * step + idx; self.random = self.random.wrapping_add(1); - self.index[idx] = Some(key.clone()); + self.index[idx] = Some(key); self.data[idx] = f(key); &self.data[idx] }