diff --git a/client/src/bin/bot/tui.rs b/client/src/bin/bot/tui.rs index 499dcd81f0..7d3528405e 100644 --- a/client/src/bin/bot/tui.rs +++ b/client/src/bin/bot/tui.rs @@ -22,7 +22,7 @@ pub struct Tui { impl Tui { pub fn new() -> (Self, async_channel::Receiver) { - let (commands_s, commands_r) = async_channel::unbounded(); + let (mut commands_s, commands_r) = async_channel::unbounded(); let handle = thread::spawn(move || { thread::sleep(Duration::from_millis(20)); @@ -36,7 +36,7 @@ impl Tui { ) .unwrap(); while let Ok(cmd) = readline.readline("\n\nbotclient> ") { - let keep_going = Self::process_command(&cmd, &commands_s); + let keep_going = Self::process_command(&cmd, &mut commands_s); readline.add_history_entry(cmd).unwrap(); if !keep_going { break; @@ -47,7 +47,7 @@ impl Tui { (Self { _handle: handle }, commands_r) } - pub fn process_command(cmd: &str, command_s: &async_channel::Sender) -> bool { + pub fn process_command(cmd: &str, command_s: &mut async_channel::Sender) -> bool { let matches = Command::new("veloren-botclient") .version(common::util::DISPLAY_VERSION_LONG.as_str()) .author("The veloren devs ") diff --git a/common/assets/src/lib.rs b/common/assets/src/lib.rs index 9b8f6102be..ee86ec8c2b 100644 --- a/common/assets/src/lib.rs +++ b/common/assets/src/lib.rs @@ -749,12 +749,12 @@ pub mod asset_tweak { run_with_file(tweak_path, |file| { file.write_all( - br" + br#" (( such: 5, field: 35.752346, )) - ", + "#, ) .expect("failed to write to the file"); diff --git a/common/src/bin/asset_migrate.rs b/common/src/bin/asset_migrate.rs index 59cf7c7314..e05e4069ff 100644 --- a/common/src/bin/asset_migrate.rs +++ b/common/src/bin/asset_migrate.rs @@ -100,11 +100,11 @@ fn input_validated_string(prompt: &str, check: &dyn Fn(&str) -> bool) -> String } fn main() { - let prompt = r" + let prompt = r#" Stub implementation. If you want to migrate new assets, edit `v1` and `v2` modules. If you want to migrate old assets, check commit history. - "; + "#; println!("{prompt}"); let old_dir = input_validated_string( diff --git a/common/src/comp/inventory/trade_pricing.rs b/common/src/comp/inventory/trade_pricing.rs index cf6dc1f71e..29c55cb3d3 100644 --- a/common/src/comp/inventory/trade_pricing.rs +++ b/common/src/comp/inventory/trade_pricing.rs @@ -1185,7 +1185,7 @@ mod tests { init(); info!("init"); - let mut stock: hashbrown::HashMap = [ + let mut stock: hashbrown::HashMap = vec![ (Good::Ingredients, 50.0), (Good::Tools, 10.0), (Good::Armor, 10.0), diff --git a/common/src/store.rs b/common/src/store.rs index d2740aa7d6..99b2f37d36 100644 --- a/common/src/store.rs +++ b/common/src/store.rs @@ -16,7 +16,7 @@ impl Id { impl Copy for Id {} impl Clone for Id { - fn clone(&self) -> Self { *self } + fn clone(&self) -> Self { Self(self.0, PhantomData) } } impl Eq for Id {} impl PartialEq for Id { diff --git a/common/systems/tests/phys/utils.rs b/common/systems/tests/phys/utils.rs index 38613f7158..071e6e8761 100644 --- a/common/systems/tests/phys/utils.rs +++ b/common/systems/tests/phys/utils.rs @@ -141,7 +141,6 @@ pub fn create_player(state: &mut State) -> Entity { .build() } -#[allow(clippy::needless_pass_by_ref_mut)] pub fn generate_chunk(state: &mut State, chunk_pos: Vec2) { let (x, y) = chunk_pos.map(|e| e.to_le_bytes()).into_tuple(); let mut rng = SmallRng::from_seed([ diff --git a/network/src/participant.rs b/network/src/participant.rs index f81af3342d..2dd245d103 100644 --- a/network/src/participant.rs +++ b/network/src/participant.rs @@ -864,7 +864,7 @@ mod tests { async fn mock_mpsc( cid: Cid, _runtime: &Arc, - create_channel: &mpsc::UnboundedSender, + create_channel: &mut mpsc::UnboundedSender, ) -> Protocols { let (s1, r1) = mpsc::channel(100); let (s2, r2) = mpsc::channel(100); @@ -887,14 +887,14 @@ mod tests { a2b_open_stream_s, b2a_stream_opened_r, mut b2a_event_r, - s2b_create_channel_s, + mut s2b_create_channel_s, s2b_shutdown_bparticipant_s, b2s_prio_statistic_r, _b2a_bandwidth_stats_r, handle, ) = mock_bparticipant(); - let _remote = runtime.block_on(mock_mpsc(0, &runtime, &s2b_create_channel_s)); + let _remote = runtime.block_on(mock_mpsc(0, &runtime, &mut s2b_create_channel_s)); std::thread::sleep(Duration::from_millis(50)); let (s, r) = oneshot::channel(); @@ -933,14 +933,14 @@ mod tests { a2b_open_stream_s, b2a_stream_opened_r, mut b2a_event_r, - s2b_create_channel_s, + mut s2b_create_channel_s, s2b_shutdown_bparticipant_s, b2s_prio_statistic_r, _b2a_bandwidth_stats_r, handle, ) = mock_bparticipant(); - let remote = runtime.block_on(mock_mpsc(0, &runtime, &s2b_create_channel_s)); + let remote = runtime.block_on(mock_mpsc(0, &runtime, &mut s2b_create_channel_s)); std::thread::sleep(Duration::from_millis(50)); let (s, r) = oneshot::channel(); @@ -980,14 +980,14 @@ mod tests { a2b_open_stream_s, b2a_stream_opened_r, _b2a_event_r, - s2b_create_channel_s, + mut s2b_create_channel_s, s2b_shutdown_bparticipant_s, b2s_prio_statistic_r, _b2a_bandwidth_stats_r, handle, ) = mock_bparticipant(); - let remote = runtime.block_on(mock_mpsc(0, &runtime, &s2b_create_channel_s)); + let remote = runtime.block_on(mock_mpsc(0, &runtime, &mut s2b_create_channel_s)); std::thread::sleep(Duration::from_millis(50)); // created stream @@ -1036,14 +1036,14 @@ mod tests { a2b_open_stream_s, mut b2a_stream_opened_r, _b2a_event_r, - s2b_create_channel_s, + mut s2b_create_channel_s, s2b_shutdown_bparticipant_s, b2s_prio_statistic_r, _b2a_bandwidth_stats_r, handle, ) = mock_bparticipant(); - let remote = runtime.block_on(mock_mpsc(0, &runtime, &s2b_create_channel_s)); + let remote = runtime.block_on(mock_mpsc(0, &runtime, &mut s2b_create_channel_s)); std::thread::sleep(Duration::from_millis(50)); // create stream diff --git a/server-cli/src/cli.rs b/server-cli/src/cli.rs index ca42975cbc..239e40967c 100644 --- a/server-cli/src/cli.rs +++ b/server-cli/src/cli.rs @@ -129,7 +129,7 @@ pub struct ArgvApp { pub command: Option, } -pub fn parse_command(input: &str, msg_s: &Sender) { +pub fn parse_command(input: &str, msg_s: &mut Sender) { match TuiApp::try_parse_from(shell_words::split(input).unwrap_or_default()) { Ok(message) => { msg_s diff --git a/server-cli/src/tui_runner.rs b/server-cli/src/tui_runner.rs index f7edf958fd..5284dd1891 100644 --- a/server-cli/src/tui_runner.rs +++ b/server-cli/src/tui_runner.rs @@ -29,7 +29,7 @@ pub struct Tui { } impl Tui { - fn handle_events(input: &mut String, msg_s: &mpsc::Sender) { + fn handle_events(input: &mut String, msg_s: &mut mpsc::Sender) { use crossterm::event::*; if let Event::Key(event) = read().unwrap() { match event.code { @@ -81,7 +81,7 @@ impl Tui { } /// In a seperate Thread - fn work_b(running: Arc, msg_s: mpsc::Sender) { + fn work_b(running: Arc, mut msg_s: mpsc::Sender) { while running.load(Ordering::Relaxed) { let mut line = String::new(); @@ -100,14 +100,14 @@ impl Tui { }, Ok(_) => { debug!(?line, "basic mode: command entered"); - cli::parse_command(line.trim(), &msg_s); + cli::parse_command(line.trim(), &mut msg_s); }, } } } /// In a seperate Thread - fn work_e(running: Arc, msg_s: mpsc::Sender) { + fn work_e(running: Arc, mut msg_s: mpsc::Sender) { // Start the tui let mut stdout = io::stdout(); execute!(stdout, EnterAlternateScreen, EnableMouseCapture).unwrap(); @@ -169,7 +169,7 @@ impl Tui { warn!(?e, "couldn't draw frame"); }; if crossterm::event::poll(Duration::from_millis(100)).unwrap() { - Self::handle_events(&mut input, &msg_s); + Self::handle_events(&mut input, &mut msg_s); }; } } diff --git a/server/agent/src/action_nodes.rs b/server/agent/src/action_nodes.rs index e7a95903fc..4e360044c1 100644 --- a/server/agent/src/action_nodes.rs +++ b/server/agent/src/action_nodes.rs @@ -1939,7 +1939,7 @@ impl<'a> AgentData<'a> { pub fn menacing( &self, - agent: &Agent, + agent: &mut Agent, controller: &mut Controller, target: EcsEntity, read_data: &ReadData, diff --git a/server/agent/src/attack.rs b/server/agent/src/attack.rs index 46c09f65ab..d6e640e1e8 100644 --- a/server/agent/src/attack.rs +++ b/server/agent/src/attack.rs @@ -2924,7 +2924,11 @@ impl<'a> AgentData<'a> { { agent.action_state.counters[FCounters::SummonThreshold as usize] -= SUMMON_THRESHOLD; - agent.action_state.conditions[Conditions::AttackToggle as usize] = !agent.action_state.conditions[Conditions::AttackToggle as usize]; + if !agent.action_state.conditions[Conditions::AttackToggle as usize] { + agent.action_state.conditions[Conditions::AttackToggle as usize] = true; + } else { + agent.action_state.conditions[Conditions::AttackToggle as usize] = false; + } } } else { // If target is in melee range use flamecrush diff --git a/server/src/cmd.rs b/server/src/cmd.rs index aedd3c0a62..b8b0d3ca63 100644 --- a/server/src/cmd.rs +++ b/server/src/cmd.rs @@ -316,7 +316,7 @@ fn no_sudo(client: EcsEntity, target: EcsEntity) -> CmdResult<()> { /// with a higher role than their permanent role allowing it, and only permanent /// roles should be recorded in the settings files. fn verify_above_role( - server: &Server, + server: &mut Server, (client, client_uuid): (EcsEntity, Uuid), (player, player_uuid): (EcsEntity, Uuid), reason: &str, @@ -379,7 +379,7 @@ fn find_username(server: &mut Server, username: &str) -> CmdResult { /// NOTE: Intended to be run only on logged-in clients. fn uuid_to_username( - server: &Server, + server: &mut Server, fallback_entity: EcsEntity, uuid: Uuid, ) -> CmdResult { @@ -405,7 +405,7 @@ fn uuid_to_username( } fn edit_setting_feedback( - server: &Server, + server: &mut Server, client: EcsEntity, result: Option<(String, Result<(), SettingError>)>, failure: impl FnOnce() -> String, @@ -2426,7 +2426,7 @@ fn handle_kit( } } -fn push_kit(kit: I, count: usize, server: &Server, target: EcsEntity) -> CmdResult<()> +fn push_kit(kit: I, count: usize, server: &mut Server, target: EcsEntity) -> CmdResult<()> where I: Iterator, { @@ -4040,7 +4040,7 @@ fn handle_buff( } } -fn cast_buff(kind: &str, data: BuffData, server: &Server, target: EcsEntity) -> CmdResult<()> { +fn cast_buff(kind: &str, data: BuffData, server: &mut Server, target: EcsEntity) -> CmdResult<()> { if let Some(buffkind) = parse_buffkind(kind) { let ecs = &server.state.ecs(); let mut buffs_all = ecs.write_storage::(); diff --git a/server/src/events/entity_manipulation.rs b/server/src/events/entity_manipulation.rs index 91dfe080a5..e1ed415f40 100644 --- a/server/src/events/entity_manipulation.rs +++ b/server/src/events/entity_manipulation.rs @@ -300,7 +300,7 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, last_change: Healt let alignments = state.ecs().read_storage::(); let uids = state.ecs().read_storage::(); - let outcomes = state.ecs().write_resource::>(); + let mut outcomes = state.ecs().write_resource::>(); let inventories = state.ecs().read_storage::(); let destroyed_group = groups.get(entity); @@ -384,7 +384,7 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, last_change: Healt attacker_inventory, &mut attacker_skill_set, attacker_uid, - &outcomes, + &mut outcomes, ); } }); @@ -1186,8 +1186,8 @@ pub fn handle_bonk(server: &mut Server, pos: Vec3, owner: Option, targ } } -pub fn handle_aura(server: &Server, entity: EcsEntity, aura_change: aura::AuraChange) { - let ecs = server.state.ecs(); +pub fn handle_aura(server: &mut Server, entity: EcsEntity, aura_change: aura::AuraChange) { + let ecs = &server.state.ecs(); let mut auras_all = ecs.write_storage::(); if let Some(mut auras) = auras_all.get_mut(entity) { use aura::AuraChange; @@ -1204,7 +1204,7 @@ pub fn handle_aura(server: &Server, entity: EcsEntity, aura_change: aura::AuraCh } } -pub fn handle_buff(server: &Server, entity: EcsEntity, buff_change: buff::BuffChange) { +pub fn handle_buff(server: &mut Server, entity: EcsEntity, buff_change: buff::BuffChange) { let ecs = &server.state.ecs(); let mut buffs_all = ecs.write_storage::(); let bodies = ecs.read_storage::(); @@ -1301,7 +1301,7 @@ fn handle_exp_gain( inventory: &Inventory, skill_set: &mut SkillSet, uid: &Uid, - outcomes: &EventBus, + outcomes: &mut EventBus, ) { use comp::inventory::{item::ItemKind, slot::EquipSlot}; @@ -1671,7 +1671,7 @@ pub fn handle_teleport_to_position(server: &mut Server, entity: EcsEntity, posit } } -pub fn handle_start_teleporting(server: &Server, entity: EcsEntity, portal: EcsEntity) { +pub fn handle_start_teleporting(server: &mut Server, entity: EcsEntity, portal: EcsEntity) { let ecs = server.state.ecs(); let positions = ecs.read_storage::(); let mut teleportings = ecs.write_storage::(); diff --git a/server/src/events/group_manip.rs b/server/src/events/group_manip.rs index 4b81ffd31a..3dbc1c1fd1 100644 --- a/server/src/events/group_manip.rs +++ b/server/src/events/group_manip.rs @@ -18,7 +18,7 @@ use specs::{ pub fn can_invite( state: &State, clients: &ReadStorage<'_, Client>, - pending_invites: &WriteStorage<'_, PendingInvites>, + pending_invites: &mut WriteStorage<'_, PendingInvites>, max_group_size: u32, inviter: Entity, invitee: Entity, diff --git a/server/src/events/interaction.rs b/server/src/events/interaction.rs index 7e4ae3e85a..fe2260c80a 100755 --- a/server/src/events/interaction.rs +++ b/server/src/events/interaction.rs @@ -391,8 +391,8 @@ pub fn handle_mine_block( } } -pub fn handle_sound(server: &Server, sound: &Sound) { - let ecs = server.state.ecs(); +pub fn handle_sound(server: &mut Server, sound: &Sound) { + let ecs = &server.state.ecs(); let positions = &ecs.read_storage::(); let agents = &mut ecs.write_storage::(); @@ -459,7 +459,7 @@ pub fn handle_create_sprite( } } -pub fn handle_tame_pet(server: &Server, pet_entity: EcsEntity, owner_entity: EcsEntity) { +pub fn handle_tame_pet(server: &mut Server, pet_entity: EcsEntity, owner_entity: EcsEntity) { // TODO: Raise outcome to send to clients to play sound/render an indicator // showing taming success? tame_pet(server.state.ecs(), pet_entity, owner_entity); diff --git a/server/src/events/invite.rs b/server/src/events/invite.rs index a4beb56bfa..a5112a2bf5 100644 --- a/server/src/events/invite.rs +++ b/server/src/events/invite.rs @@ -71,7 +71,7 @@ pub fn handle_invite(server: &mut Server, inviter: Entity, invitee_uid: Uid, kin if !group_manip::can_invite( state, &clients, - &pending_invites, + &mut pending_invites, max_group_size, inviter, invitee, @@ -275,7 +275,7 @@ pub fn handle_invite_accept(server: &mut Server, entity: Entity) { } } -fn get_inviter_and_kind(entity: Entity, state: &State) -> Option<(Entity, InviteKind)> { +fn get_inviter_and_kind(entity: Entity, state: &mut State) -> Option<(Entity, InviteKind)> { let mut invites = state.ecs().write_storage::(); invites.remove(entity).and_then(|invite| { let Invite { inviter, kind } = invite; @@ -294,7 +294,7 @@ fn get_inviter_and_kind(entity: Entity, state: &State) -> Option<(Entity, Invite } fn handle_invite_answer( - state: &State, + state: &mut State, inviter: Entity, entity: Entity, invite_answer: InviteAnswer, diff --git a/server/src/events/player.rs b/server/src/events/player.rs index 2d3939d3a6..91f10f54d3 100644 --- a/server/src/events/player.rs +++ b/server/src/events/player.rs @@ -253,7 +253,7 @@ pub fn handle_client_disconnect( // temporarily unable to log in during this period to avoid // the race condition of their login fetching their old data // and overwriting the data saved here. -fn persist_entity(state: &State, entity: EcsEntity) -> EcsEntity { +fn persist_entity(state: &mut State, entity: EcsEntity) -> EcsEntity { if let ( Some(presence), Some(skill_set), diff --git a/server/src/events/trade.rs b/server/src/events/trade.rs index d716e2245b..c2db4f00d1 100644 --- a/server/src/events/trade.rs +++ b/server/src/events/trade.rs @@ -54,7 +54,7 @@ fn notify_agent_prices( /// Invoked when the trade UI is up, handling item changes, accepts, etc pub(super) fn handle_process_trade_action( - server: &Server, + server: &mut Server, entity: EcsEntity, trade_id: TradeId, action: TradeAction, @@ -169,7 +169,7 @@ pub(super) fn handle_process_trade_action( /// longer exists or is awareof this cancellation through other means (e.g. /// client getting ExitInGameSuccess message knows that it should clear any /// trades). -pub(crate) fn cancel_trades_for(state: &common_state::State, entity: EcsEntity) { +pub(crate) fn cancel_trades_for(state: &mut common_state::State, entity: EcsEntity) { let ecs = state.ecs(); if let Some(uid) = ecs.uid_from_entity(entity) { let mut trades = ecs.write_resource::(); diff --git a/server/src/lib.rs b/server/src/lib.rs index 05b72816fa..0cba9d93be 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -1173,9 +1173,9 @@ impl Server { /// due to a persistence transaction failure and returns the processed /// DisconnectionType fn disconnect_all_clients_if_requested(&mut self) -> Option { - let character_updater = self.state.ecs().fetch_mut::(); + let mut character_updater = self.state.ecs().fetch_mut::(); - let disconnect_type = self.get_disconnect_all_clients_requested(&character_updater); + let disconnect_type = self.get_disconnect_all_clients_requested(&mut character_updater); if let Some(disconnect_type) = disconnect_type { let with_persistence = disconnect_type == DisconnectType::WithPersistence; let clients = self.state.ecs().read_storage::(); @@ -1206,7 +1206,7 @@ impl Server { fn get_disconnect_all_clients_requested( &self, - character_updater: &CharacterUpdater, + character_updater: &mut CharacterUpdater, ) -> Option { let without_persistence_requested = character_updater.disconnect_all_clients_requested(); let with_persistence_requested = self.disconnect_all_clients_requested; diff --git a/server/src/persistence/character.rs b/server/src/persistence/character.rs index a44d35acb0..3758dbd7dc 100644 --- a/server/src/persistence/character.rs +++ b/server/src/persistence/character.rs @@ -1062,7 +1062,7 @@ pub fn update( // The `defer_foreign_keys` pragma treats the foreign key // constraints as deferred for the next transaction (it turns itself // off at the commit boundary). https://sqlite.org/foreignkeys.html#fk_deferred - transaction.pragma_update(None, "defer_foreign_keys", "ON".to_string())?; + transaction.pragma_update(None, "defer_foreign_keys", &"ON".to_string())?; let mut stmt = transaction.prepare_cached( " diff --git a/server/src/sys/mod.rs b/server/src/sys/mod.rs index 2e1ff77d60..9e71553634 100644 --- a/server/src/sys/mod.rs +++ b/server/src/sys/mod.rs @@ -44,7 +44,7 @@ pub fn add_server_systems(dispatch_builder: &mut DispatcherBuilder) { dispatch::(dispatch_builder, &[]); } -pub fn run_sync_systems(ecs: &specs::World) { +pub fn run_sync_systems(ecs: &mut specs::World) { // Setup for entity sync // If I'm not mistaken, these two could be ran in parallel run_now::(ecs); diff --git a/voxygen/egui/src/lib.rs b/voxygen/egui/src/lib.rs index a089f00633..d9037349ba 100644 --- a/voxygen/egui/src/lib.rs +++ b/voxygen/egui/src/lib.rs @@ -517,7 +517,7 @@ pub fn maintain_egui_inner( } fn selected_entity_window( - platform: &Platform, + platform: &mut Platform, ecs: &World, selected_entity_info: &mut SelectedEntityInfo, egui_actions: &mut EguiActions, diff --git a/voxygen/src/cmd.rs b/voxygen/src/cmd.rs index a64381f7c5..3800b79a7e 100644 --- a/voxygen/src/cmd.rs +++ b/voxygen/src/cmd.rs @@ -196,7 +196,7 @@ fn invalid_command_message(client: &Client, user_entered_invalid_command: String } fn run_client_command( - client: &Client, + client: &mut Client, global_state: &mut GlobalState, command: ClientChatCommand, args: Vec, @@ -407,7 +407,7 @@ impl TabComplete for ArgumentSpec { .filter(|string| string.starts_with(part)) .map(|c| c.to_string()) .collect(), - ArgumentSpec::Boolean(_, part, _) => ["true", "false"] + ArgumentSpec::Boolean(_, part, _) => vec!["true", "false"] .iter() .filter(|string| string.starts_with(part)) .map(|c| c.to_string()) diff --git a/voxygen/src/hud/bag.rs b/voxygen/src/hud/bag.rs index 83c16f5f9e..4ad354a3b2 100644 --- a/voxygen/src/hud/bag.rs +++ b/voxygen/src/hud/bag.rs @@ -196,7 +196,7 @@ impl<'a> InventoryScroller<'a> { .set(self.bg_ids.bg_frame, ui); } - fn title(&mut self, state: &ConrodState<'_, InventoryScrollerState>, ui: &mut UiCell<'_>) { + fn title(&mut self, state: &mut ConrodState<'_, InventoryScrollerState>, ui: &mut UiCell<'_>) { Text::new( &self .localized_strings @@ -371,7 +371,7 @@ impl<'a> InventoryScroller<'a> { }); } for (pos, item) in items.into_iter() { - if self.details_mode && !self.is_us && item.is_none() { + if self.details_mode && !self.is_us && matches!(item, None) { continue; } let (x, y) = if self.details_mode { @@ -488,7 +488,7 @@ impl<'a> InventoryScroller<'a> { fn footer_metrics( &mut self, - state: &ConrodState<'_, InventoryScrollerState>, + state: &mut ConrodState<'_, InventoryScrollerState>, ui: &mut UiCell<'_>, ) { let space_used = self.inventory.populated_slots(); diff --git a/voxygen/src/hud/chat.rs b/voxygen/src/hud/chat.rs index 056347c9cc..06286f0ed7 100644 --- a/voxygen/src/hud/chat.rs +++ b/voxygen/src/hud/chat.rs @@ -874,13 +874,13 @@ mod tests { #[test] fn parse_cmds() { let expected: Result<(String, Vec), String> = Ok(("help".to_string(), vec![])); - assert_eq!(parse_cmd(r"help"), expected); + assert_eq!(parse_cmd(r#"help"#), expected); let expected: Result<(String, Vec), String> = Ok(("say".to_string(), vec![ "foo".to_string(), "bar".to_string(), ])); - assert_eq!(parse_cmd(r"say foo bar"), expected); + assert_eq!(parse_cmd(r#"say foo bar"#), expected); assert_eq!(parse_cmd(r#"say "foo" "bar""#), expected); let expected: Result<(String, Vec), String> = diff --git a/voxygen/src/hud/crafting.rs b/voxygen/src/hud/crafting.rs index 0b4d52b15f..c631fc9cbe 100644 --- a/voxygen/src/hud/crafting.rs +++ b/voxygen/src/hud/crafting.rs @@ -1479,7 +1479,7 @@ impl<'a> Widget for Crafting<'a> { }); self.inventory .slots_with_id() - .filter(|(_, item)| item.as_ref().map_or(false, can_repair)) + .filter(|(_, item)| item.as_ref().map_or(false, |i| can_repair(i))) .for_each(|(slot, _)| { events.push(Event::RepairItem { slot: Slot::Inventory(slot), @@ -1489,7 +1489,7 @@ impl<'a> Widget for Crafting<'a> { let can_perform = repair_slot .item(self.inventory) - .map_or(false, can_repair); + .map_or(false, |item| can_repair(item)); (repair_slot.slot, None, can_perform) }, diff --git a/voxygen/src/hud/diary.rs b/voxygen/src/hud/diary.rs index 724c85dd74..ebe262af66 100644 --- a/voxygen/src/hud/diary.rs +++ b/voxygen/src/hud/diary.rs @@ -2572,7 +2572,7 @@ impl<'a> Diary<'a> { ui: &mut UiCell, events: &mut Vec, diary_tooltip: &Tooltip, - state: &State, + state: &mut State, ) { for (i, icon) in icons.iter().enumerate() { match icon { @@ -2824,7 +2824,7 @@ impl<'a> Diary<'a> { ui: &mut UiCell, events: &mut Vec, diary_tooltip: &Tooltip, - state: &State, + state: &mut State, ) { let locked = !self.skill_set.prerequisites_met(skill); let owned = self.skill_set.has_skill(skill); diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 7536042f43..8f1b4106df 100755 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -516,7 +516,19 @@ impl BuffIconKind { impl PartialOrd for BuffIconKind { fn partial_cmp(&self, other: &Self) -> Option { - Some(self.cmp(other)) + match (self, other) { + ( + BuffIconKind::Buff { kind, .. }, + BuffIconKind::Buff { + kind: other_kind, .. + }, + ) => Some(kind.cmp(other_kind)), + (BuffIconKind::Buff { .. }, BuffIconKind::Stance(_)) => Some(Ordering::Greater), + (BuffIconKind::Stance(_), BuffIconKind::Buff { .. }) => Some(Ordering::Less), + (BuffIconKind::Stance(stance), BuffIconKind::Stance(stance_other)) => { + Some(stance.cmp(stance_other)) + }, + } } } @@ -574,7 +586,7 @@ impl BuffIcon { buffs .iter_active() .filter_map(BuffIcon::from_buffs) - .chain(stance.and_then(BuffIcon::from_stance)) + .chain(stance.and_then(BuffIcon::from_stance).into_iter()) .collect::>() } @@ -1077,7 +1089,7 @@ impl Show { || !matches!(self.open_windows, Windows::None) } - fn toggle_windows(&mut self, global_state: &GlobalState) { + fn toggle_windows(&mut self, global_state: &mut GlobalState) { if self.any_window_requires_cursor() { self.bag = false; self.trade = false; @@ -1134,7 +1146,7 @@ impl Show { /// If all of the menus are closed, adjusts coordinates of cursor to center /// of screen - fn toggle_cursor_on_menu_close(&self, global_state: &GlobalState, ui: &mut Ui) { + fn toggle_cursor_on_menu_close(&self, global_state: &mut GlobalState, ui: &mut Ui) { if !self.bag && !self.trade && !self.esc_menu diff --git a/voxygen/src/hud/quest.rs b/voxygen/src/hud/quest.rs index 342cb30649..332224df9f 100644 --- a/voxygen/src/hud/quest.rs +++ b/voxygen/src/hud/quest.rs @@ -223,7 +223,7 @@ impl<'a> Widget for Quest<'a> { // [amount, item_desc] //("common.items.weapons.sword.caladbolg"); - let rewards = [ + let rewards = vec![ (1, "common.items.weapons.dagger.starter_dagger", "Dagger"), (4, "common.items.crafting_ing.seashells", "Seashell"), ( diff --git a/voxygen/src/hud/trade.rs b/voxygen/src/hud/trade.rs index be3fa4d4f7..63599aec65 100644 --- a/voxygen/src/hud/trade.rs +++ b/voxygen/src/hud/trade.rs @@ -143,7 +143,7 @@ impl<'a> Trade<'a> { const MAX_TRADE_SLOTS: usize = 16; impl<'a> Trade<'a> { - fn background(&mut self, state: &ConrodState<'_, State>, ui: &mut UiCell<'_>) { + fn background(&mut self, state: &mut ConrodState<'_, State>, ui: &mut UiCell<'_>) { Image::new(self.imgs.inv_middle_bg_bag) .w_h(424.0, 482.0) .color(Some(UI_MAIN)) @@ -156,7 +156,7 @@ impl<'a> Trade<'a> { .set(state.ids.bg_frame, ui); } - fn title(&mut self, state: &ConrodState<'_, State>, ui: &mut UiCell<'_>) { + fn title(&mut self, state: &mut ConrodState<'_, State>, ui: &mut UiCell<'_>) { Text::new(&self.localized_strings.get_msg("hud-trade-trade_window")) .mid_top_with_margin_on(state.ids.bg_frame, 9.0) .font_id(self.fonts.cyri.conrod_id) @@ -173,7 +173,7 @@ impl<'a> Trade<'a> { fn phase_indicator( &mut self, - state: &ConrodState<'_, State>, + state: &mut ConrodState<'_, State>, ui: &mut UiCell<'_>, trade: &'a PendingTrade, ) { @@ -566,7 +566,7 @@ impl<'a> Trade<'a> { fn accept_decline_buttons( &mut self, - state: &ConrodState<'_, State>, + state: &mut ConrodState<'_, State>, ui: &mut UiCell<'_>, trade: &'a PendingTrade, ) -> Option { @@ -632,7 +632,7 @@ impl<'a> Trade<'a> { fn input_item_amount( &mut self, - state: &ConrodState<'_, State>, + state: &mut ConrodState<'_, State>, ui: &mut UiCell<'_>, trade: &'a PendingTrade, ) -> Option { @@ -760,7 +760,7 @@ impl<'a> Trade<'a> { fn close_button( &mut self, - state: &ConrodState<'_, State>, + state: &mut ConrodState<'_, State>, ui: &mut UiCell<'_>, ) -> Option { if Button::image(self.imgs.close_btn) diff --git a/voxygen/src/mesh/terrain.rs b/voxygen/src/mesh/terrain.rs index c571227102..54790aab4b 100644 --- a/voxygen/src/mesh/terrain.rs +++ b/voxygen/src/mesh/terrain.rs @@ -529,8 +529,8 @@ pub fn generate_mesh<'a>( ( opaque_deep .into_iter() - .chain(opaque_shallow) - .chain(opaque_surface) + .chain(opaque_shallow.into_iter()) + .chain(opaque_surface.into_iter()) .collect(), fluid_mesh, Mesh::new(), diff --git a/voxygen/src/render/renderer/pipeline_creation.rs b/voxygen/src/render/renderer/pipeline_creation.rs index f1bf9c46f1..dc0f176870 100644 --- a/voxygen/src/render/renderer/pipeline_creation.rs +++ b/voxygen/src/render/renderer/pipeline_creation.rs @@ -275,7 +275,7 @@ impl ShaderModules { }) .unwrap(); - let compiler = Compiler::new().ok_or(RenderError::ErrorInitializingCompiler)?; + let mut compiler = Compiler::new().ok_or(RenderError::ErrorInitializingCompiler)?; let mut options = CompileOptions::new().ok_or(RenderError::ErrorInitializingCompiler)?; options.set_optimization_level(OptimizationLevel::Performance); options.set_forced_version_profile(430, shaderc::GlslProfile::Core); @@ -306,13 +306,13 @@ impl ShaderModules { }) }); - let create_shader = |name, kind| { + let mut create_shader = |name, kind| { let glsl = &shaders .get(name) .unwrap_or_else(|| panic!("Can't retrieve shader: {}", name)) .0; let file_name = format!("{}.glsl", name); - create_shader_module(device, &compiler, glsl, kind, &file_name, &options) + create_shader_module(device, &mut compiler, glsl, kind, &file_name, &options) }; let selected_fluid_shader = ["fluid-frag.", match pipeline_modes.fluid { @@ -388,7 +388,7 @@ impl ShaderModules { fn create_shader_module( device: &wgpu::Device, - compiler: &shaderc::Compiler, + compiler: &mut shaderc::Compiler, source: &str, kind: shaderc::ShaderKind, file_name: &str, diff --git a/voxygen/src/scene/figure/load.rs b/voxygen/src/scene/figure/load.rs index 3d987939f0..5b6acc7ce6 100644 --- a/voxygen/src/scene/figure/load.rs +++ b/voxygen/src/scene/figure/load.rs @@ -1069,7 +1069,7 @@ fn mesh_hold() -> BoneMeshes { ) } -////// +///////// #[derive(Deserialize)] struct QuadrupedSmallCentralSpec(HashMap<(QSSpecies, QSBodyType), SidedQSCentralVoxSpec>); @@ -1660,7 +1660,7 @@ impl QuadrupedMediumLateralSpec { } } -////// +//// #[derive(Deserialize)] struct BirdMediumCentralSpec(HashMap<(BMSpecies, BMBodyType), SidedBMCentralVoxSpec>); @@ -1914,7 +1914,7 @@ impl BirdMediumLateralSpec { } } -////// +//// #[derive(Deserialize)] struct TheropodCentralSpec(HashMap<(TSpecies, TBodyType), SidedTCentralVoxSpec>); @@ -2244,7 +2244,7 @@ impl TheropodLateralSpec { } } -////// +//// #[derive(Deserialize)] struct ArthropodCentralSpec(HashMap<(ASpecies, ABodyType), SidedACentralVoxSpec>); @@ -2644,7 +2644,7 @@ impl ArthropodLateralSpec { (lateral, Vec3::from(spec.leg_br.offset)) } } -////// +//// #[derive(Deserialize)] struct FishMediumCentralSpec(HashMap<(FMSpecies, FMBodyType), SidedFMCentralVoxSpec>); @@ -2850,7 +2850,7 @@ impl FishMediumLateralSpec { } } -////// +//// #[derive(Deserialize)] struct FishSmallCentralSpec(HashMap<(FSSpecies, FSBodyType), SidedFSCentralVoxSpec>); @@ -2994,7 +2994,7 @@ impl FishSmallLateralSpec { } } -////// +//// #[derive(Deserialize)] struct BipedSmallWeaponSpec(HashMap); @@ -3269,8 +3269,8 @@ impl BipedSmallWeaponSpec { (tool_kind_segment, offset) } } +//// -////// #[derive(Deserialize)] struct DragonCentralSpec(HashMap<(DSpecies, DBodyType), SidedDCentralVoxSpec>); @@ -3641,7 +3641,7 @@ impl DragonLateralSpec { } } -////// +//// #[derive(Deserialize)] struct BirdLargeCentralSpec(HashMap<(BLASpecies, BLABodyType), SidedBLACentralVoxSpec>); @@ -4044,7 +4044,7 @@ impl BirdLargeLateralSpec { } } -////// +//// #[derive(Deserialize)] struct BipedLargeCentralSpec(HashMap<(BLSpecies, BLBodyType), SidedBLCentralVoxSpec>); @@ -4462,8 +4462,7 @@ impl BipedLargeSecondSpec { (tool_kind_segment, offset) } } - -////// +//// #[derive(Deserialize)] struct GolemCentralSpec(HashMap<(GSpecies, GBodyType), SidedGCentralVoxSpec>); @@ -4773,7 +4772,8 @@ impl GolemLateralSpec { } } -////// +///// + #[derive(Deserialize)] struct QuadrupedLowCentralSpec(HashMap<(QLSpecies, QLBodyType), SidedQLCentralVoxSpec>); @@ -5050,7 +5050,8 @@ impl QuadrupedLowLateralSpec { } } -////// +//// + #[derive(Deserialize)] struct ObjectCentralSpec(HashMap); diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index fdf87cfdd0..1eadad047b 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -527,7 +527,7 @@ pub struct FigureMgr { } impl FigureMgr { - pub fn new(renderer: &Renderer) -> Self { + pub fn new(renderer: &mut Renderer) -> Self { Self { atlas: FigureAtlas::new(renderer), model_cache: FigureModelCache::new(), @@ -1101,8 +1101,8 @@ impl FigureMgr { let holding_lantern = inventory .map_or(false, |i| i.equipped(EquipSlot::Lantern).is_some()) && light_emitter.is_some() - && !(second_tool_hand.is_some() - || matches!(active_tool_hand, Some(Hands::Two)) + && !((matches!(second_tool_hand, Some(_)) + || matches!(active_tool_hand, Some(Hands::Two))) && character.map_or(false, |c| c.is_wield())) && !character.map_or(false, |c| c.is_using_hands()) && physics.in_liquid().is_none(); @@ -7373,7 +7373,7 @@ pub struct FigureAtlas { } impl FigureAtlas { - pub fn new(renderer: &Renderer) -> Self { + pub fn new(renderer: &mut Renderer) -> Self { let allocator = Self::make_allocator(renderer).expect("Failed to create texture atlas for figures"); Self { @@ -7499,7 +7499,7 @@ impl FigureAtlas { } } - fn make_allocator(renderer: &Renderer) -> Result { + fn make_allocator(renderer: &mut Renderer) -> Result { let max_texture_size = renderer.max_texture_size(); let atlas_size = guillotiere::Size::new(max_texture_size as i32, max_texture_size as i32); let allocator = AtlasAllocator::with_options(atlas_size, &guillotiere::AllocatorOptions { diff --git a/voxygen/src/scene/simple.rs b/voxygen/src/scene/simple.rs index 4f0f5ee3e9..f7ae644869 100644 --- a/voxygen/src/scene/simple.rs +++ b/voxygen/src/scene/simple.rs @@ -137,7 +137,7 @@ impl Scene { figure_state: None, backdrop: backdrop.map(|specifier| { - let mut state = FigureState::new(renderer, FixtureSkeleton, ()); + let mut state = FigureState::new(renderer, FixtureSkeleton::default(), ()); let mut greedy = FigureModel::make_greedy(); let mut opaque_mesh = Mesh::new(); let (segment, offset) = load_mesh(specifier, Vec3::new(-55.0, -49.5, -2.0)); diff --git a/voxygen/src/scene/terrain.rs b/voxygen/src/scene/terrain.rs index 7c3b3e4d0d..a7f526747d 100644 --- a/voxygen/src/scene/terrain.rs +++ b/voxygen/src/scene/terrain.rs @@ -437,8 +437,8 @@ fn mesh_worker( ( deep_level .into_iter() - .chain(shallow_level) - .chain(surface_level) + .chain(shallow_level.into_iter()) + .chain(surface_level.into_iter()) .collect(), alt_indices, ) @@ -535,7 +535,7 @@ pub struct SpriteRenderContext { pub type SpriteRenderContextLazy = Box SpriteRenderContext>; impl SpriteRenderContext { - pub fn new(renderer: &Renderer) -> SpriteRenderContextLazy { + pub fn new(renderer: &mut Renderer) -> SpriteRenderContextLazy { let max_texture_size = renderer.max_texture_size(); struct SpriteWorkerResponse { diff --git a/voxygen/src/session/interactable.rs b/voxygen/src/session/interactable.rs index 78f5f40ab8..9a35bf98ab 100644 --- a/voxygen/src/session/interactable.rs +++ b/voxygen/src/session/interactable.rs @@ -59,7 +59,7 @@ impl Interactable { volume_pos: VolumePos, interaction: Interaction, ) -> Option { - let block= volume_pos.get_block(terrain, id_maps, colliders)?; + let Some(block) = volume_pos.get_block(terrain, id_maps, colliders) else { return None }; let block_interaction = match interaction { Interaction::Collect => { // Check if this is an unlockable sprite diff --git a/voxygen/src/session/settings_change.rs b/voxygen/src/session/settings_change.rs index dc39177b52..7315059f54 100644 --- a/voxygen/src/session/settings_change.rs +++ b/voxygen/src/session/settings_change.rs @@ -793,7 +793,7 @@ pub fn change_render_mode( fn adjust_terrain_view_distance( terrain_vd: u32, settings: &mut Settings, - session_state: &SessionState, + session_state: &mut SessionState, ) { settings.graphics.terrain_view_distance = terrain_vd; client_set_view_distance(settings, session_state); @@ -802,13 +802,13 @@ fn adjust_terrain_view_distance( fn adjust_entity_view_distance( entity_vd: u32, settings: &mut Settings, - session_state: &SessionState, + session_state: &mut SessionState, ) { settings.graphics.entity_view_distance = entity_vd; client_set_view_distance(settings, session_state); } -fn client_set_view_distance(settings: &Settings, session_state: &SessionState) { +fn client_set_view_distance(settings: &Settings, session_state: &mut SessionState) { let view_distances = common::ViewDistances { terrain: settings.graphics.terrain_view_distance, entity: settings.graphics.entity_view_distance, diff --git a/voxygen/src/ui/ice/renderer/mod.rs b/voxygen/src/ui/ice/renderer/mod.rs index cce446cd12..cafa592aaa 100644 --- a/voxygen/src/ui/ice/renderer/mod.rs +++ b/voxygen/src/ui/ice/renderer/mod.rs @@ -5,7 +5,7 @@ mod widget; pub use defaults::Defaults; -use primitive::Primitive; +pub(self) use primitive::Primitive; use super::{ super::graphic::{self, Graphic, TexId}, diff --git a/voxygen/src/window.rs b/voxygen/src/window.rs index c1cc1fb621..dfefd0d6d8 100644 --- a/voxygen/src/window.rs +++ b/voxygen/src/window.rs @@ -675,7 +675,6 @@ impl Window { .game_analog_button_map .get(&AnalogButton::from((button, code))) { - #[allow(clippy::never_loop)] for action in actions { match *action {} } @@ -685,7 +684,6 @@ impl Window { .menu_analog_button_map .get(&AnalogButton::from((button, code))) { - #[allow(clippy::never_loop)] for action in actions { match *action {} } diff --git a/world/examples/chunk_compression_benchmarks.rs b/world/examples/chunk_compression_benchmarks.rs index f3f7c2e2d3..d8fc915a87 100644 --- a/world/examples/chunk_compression_benchmarks.rs +++ b/world/examples/chunk_compression_benchmarks.rs @@ -691,7 +691,7 @@ fn main() { let k = 32; let sz = world.sim().get_size(); - let sites = [ + let sites = vec![ ("center", sz / 2), ( "dungeon", diff --git a/world/examples/namegen.rs b/world/examples/namegen.rs index 85be746c35..be0a8bc3b8 100644 --- a/world/examples/namegen.rs +++ b/world/examples/namegen.rs @@ -11,7 +11,7 @@ fn main() { ]); let mut middle = cons.clone(); middle.extend(vec!["tt"]); - let vowel = ["o", "e", "a", "i", "u", "au", "ee", "ow", "ay", "ey", "oe"]; + let vowel = vec!["o", "e", "a", "i", "u", "au", "ee", "ow", "ay", "ey", "oe"]; let end = vec![ "et", "ige", "age", "ist", "en", "on", "og", "end", "ind", "ock", "een", "edge", "ist", "ed", "est", "eed", "ast", "olt", "ey", "ean", "ead", "onk", "ink", "eon", "er", "ow", diff --git a/world/examples/world_block_statistics.rs b/world/examples/world_block_statistics.rs index af03e04df1..cce21a0259 100644 --- a/world/examples/world_block_statistics.rs +++ b/world/examples/world_block_statistics.rs @@ -198,7 +198,7 @@ fn palette(conn: Connection) -> Result<(), Box> { let count: i64 = row.get(4)?; block_colors .entry(kind) - .or_default() + .or_insert_with(Vec::new) .push((rgb, count)); } for (_, v) in block_colors.iter_mut() { @@ -207,7 +207,7 @@ fn palette(conn: Connection) -> Result<(), Box> { let mut palettes: HashMap>> = HashMap::new(); for (kind, colors) in block_colors.iter() { - let palette = palettes.entry(*kind).or_default(); + let palette = palettes.entry(*kind).or_insert_with(Vec::new); if colors.len() <= 256 { for (color, _) in colors { palette.push(*color); diff --git a/world/src/civ/mod.rs b/world/src/civ/mod.rs index f8c258de1c..abd12dc5e3 100644 --- a/world/src/civ/mod.rs +++ b/world/src/civ/mod.rs @@ -1514,7 +1514,7 @@ impl Civs { /// Attempt to find a path between two locations fn find_path( - ctx: &GenCtx, + ctx: &mut GenCtx, get_bridge: impl Fn(Vec2) -> Option>, a: Vec2, b: Vec2, diff --git a/world/src/layer/mod.rs b/world/src/layer/mod.rs index 5e9a8c1233..c1aa677732 100644 --- a/world/src/layer/mod.rs +++ b/world/src/layer/mod.rs @@ -1036,6 +1036,7 @@ pub fn apply_caverns_to(canvas: &mut Canvas, dynamic_rng: &mut R) { } }; + let cavern_top = cavern_top; let mut last_kind = BlockKind::Rock; for z in cavern_bottom - 1..cavern_top { use SpriteKind::*; diff --git a/world/src/site/namegen.rs b/world/src/site/namegen.rs index 7ffde99f91..c36f2be241 100644 --- a/world/src/site/namegen.rs +++ b/world/src/site/namegen.rs @@ -31,7 +31,7 @@ impl<'a, R: Rng> NameGen<'a, R> { ]); let mut middle = cons.clone(); middle.extend(vec!["tt"]); - let vowel = ["o", "e", "a", "i", "u", "au", "ee", "ow", "ay", "ey", "oe"]; + let vowel = vec!["o", "e", "a", "i", "u", "au", "ee", "ow", "ay", "ey", "oe"]; let end = vec![ "et", "ige", "age", "ist", "en", "on", "og", "end", "ind", "ock", "een", "edge", "ist", "ed", "est", "eed", "ast", "olt", "ey", "ean", "ead", "onk", "ink", "eon", "er", "ow", diff --git a/world/src/site/settlement/building/archetype/house.rs b/world/src/site/settlement/building/archetype/house.rs index bcc5921115..6904f5093b 100644 --- a/world/src/site/settlement/building/archetype/house.rs +++ b/world/src/site/settlement/building/archetype/house.rs @@ -641,7 +641,7 @@ impl Archetype for House { % 6 { 0 => SpriteKind::HangingSign, - 1..=3 => SpriteKind::HangingBasket, + 1 | 2 | 3 => SpriteKind::HangingBasket, 4 => SpriteKind::WallSconce, 5 => SpriteKind::WallLampSmall, _ => SpriteKind::DungeonWallDecor, diff --git a/world/src/site/settlement/mod.rs b/world/src/site/settlement/mod.rs index 6ac38ebfa2..bd49b19e05 100644 --- a/world/src/site/settlement/mod.rs +++ b/world/src/site/settlement/mod.rs @@ -1414,7 +1414,7 @@ impl Land { } } - closed.into_iter().chain(open).collect() + closed.into_iter().chain(open.into_iter()).collect() } fn write_path( diff --git a/world/src/site2/plot/gnarling.rs b/world/src/site2/plot/gnarling.rs index f056084276..837390d8c6 100644 --- a/world/src/site2/plot/gnarling.rs +++ b/world/src/site2/plot/gnarling.rs @@ -298,7 +298,7 @@ impl GnarlingFortification { wall_connections .iter() .copied() - .zip(inner_tower_locs), + .zip(inner_tower_locs.into_iter()), ) .collect::>(); @@ -454,6 +454,7 @@ impl Structure for GnarlingFortification { }) .for_each(|(point, next_point)| { // 2d world positions of each point in wall segment + let point = point; let start_wpos = point + self.origin; let end_wpos = next_point + self.origin; @@ -1828,7 +1829,7 @@ impl Structure for GnarlingFortification { } tunnels .into_iter() - .chain(rooms) + .chain(rooms.into_iter()) .chain(core::iter::once(boss_room)) .chain(core::iter::once(stump)) .for_each(|prim| prim.fill(wood.clone())); @@ -1838,7 +1839,7 @@ impl Structure for GnarlingFortification { let mut sprite_clear = Vec::new(); tunnels_clear .into_iter() - .chain(rooms_clear) + .chain(rooms_clear.into_iter()) .chain(core::iter::once(boss_room_clear)) .for_each(|prim| { sprite_clear.push(prim.translate(Vec3::new(0, 0, 1)).intersect(prim));