diff --git a/client/src/lib.rs b/client/src/lib.rs index 44127459c3..808e1bae3a 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -439,7 +439,7 @@ impl Client { auth_trusted: impl FnMut(&str) -> bool, init_stage_update: &(dyn Fn(ClientInitStage) + Send + Sync), add_foreign_systems: impl Fn(&mut DispatcherBuilder) + Send + 'static, - #[allow(unused_variables)] config_dir: PathBuf, + #[cfg_attr(not(feature = "plugins"), allow(unused_variables))] config_dir: PathBuf, ) -> Result { let network = Network::new(Pid::new(), &runtime); @@ -615,7 +615,6 @@ impl Client { init_stage_update(ClientInitStage::LoadingInitData); // Wait for initial sync let mut ping_interval = tokio::time::interval(Duration::from_secs(1)); - #[allow(unused_variables)] let ServerInit::GameSync { entity_package, time_of_day, @@ -629,7 +628,7 @@ impl Client { server_constants, repair_recipe_book, description, - active_plugins, + active_plugins: _active_plugins, } = loop { tokio::select! { // Spawn in a blocking thread (leaving the network thread free). This is mostly @@ -666,14 +665,15 @@ impl Client { #[cfg(feature = "plugins")] common_state::plugin::PluginMgr::from_asset_or_default(), ); - #[allow(unused_mut)] + + #[cfg_attr(not(feature = "plugins"), allow(unused_mut))] let mut missing_plugins: Vec = Vec::new(); - #[allow(unused_mut)] + #[cfg_attr(not(feature = "plugins"), allow(unused_mut))] let mut local_plugins: Vec = Vec::new(); #[cfg(feature = "plugins")] { let already_present = state.ecs().read_resource::().plugin_list(); - for hash in active_plugins.iter() { + for hash in _active_plugins.iter() { if !already_present.contains(hash) { // look in config_dir first (cache) if let Ok(local_path) = common_state::plugin::find_cached(&config_dir, hash) diff --git a/voxygen/src/menu/char_selection/mod.rs b/voxygen/src/menu/char_selection/mod.rs index 22030a98c0..0090e4ab98 100644 --- a/voxygen/src/menu/char_selection/mod.rs +++ b/voxygen/src/menu/char_selection/mod.rs @@ -278,16 +278,17 @@ impl PlayState for CharSelectionState { Rc::clone(&self.client), ))); }, - client::Event::PluginDataReceived(_data) => { + #[cfg_attr(not(feature = "plugins"), allow(unused_variables))] + client::Event::PluginDataReceived(data) => { #[cfg(feature = "plugins")] { - tracing::info!("plugin data {}", _data.len()); + tracing::info!("plugin data {}", data.len()); let mut client = self.client.borrow_mut(); let hash = client .state() .ecs() .write_resource::() - .cache_server_plugin(&global_state.config_dir, _data); + .cache_server_plugin(&global_state.config_dir, data); match hash { Ok(hash) => { if client.plugin_received(hash) == 0 { diff --git a/voxygen/src/menu/main/mod.rs b/voxygen/src/menu/main/mod.rs index 5149a14d2a..8b04c092ff 100644 --- a/voxygen/src/menu/main/mod.rs +++ b/voxygen/src/menu/main/mod.rs @@ -284,16 +284,17 @@ impl PlayState for MainMenuState { ); self.init = InitState::None; }, - client::Event::PluginDataReceived(_data) => { + #[cfg_attr(not(feature = "plugins"), allow(unused_variables))] + client::Event::PluginDataReceived(data) => { #[cfg(feature = "plugins")] { - tracing::info!("plugin data {}", _data.len()); + tracing::info!("plugin data {}", data.len()); if let InitState::Pipeline(client) = &mut self.init { let hash = client .state() .ecs() .write_resource::() - .cache_server_plugin(&global_state.config_dir, _data); + .cache_server_plugin(&global_state.config_dir, data); match hash { Ok(hash) => { if client.plugin_received(hash) == 0 {