diff --git a/Cargo.lock b/Cargo.lock index 640b3eba..eb477815 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "ab_glyph" @@ -3160,7 +3160,7 @@ dependencies = [ "ipfs", "isahc", "num", - "num-derive 0.3.3", + "num-derive", "num-traits", "once_cell", "serde", @@ -3173,7 +3173,7 @@ dependencies = [ [[package]] name = "dcl-rpc" version = "2.3.5" -source = "git+https://github.com/decentraland/rpc-rust?branch=chore/bump-tokio-tungstenite#2422cc210de8c07a3ade39347257dc3b0848ac7e" +source = "git+https://github.com/decentraland/rpc-rust?branch=chore%2Fbump-tokio-tungstenite#2422cc210de8c07a3ade39347257dc3b0848ac7e" dependencies = [ "async-channel 1.9.0", "async-trait", @@ -7160,17 +7160,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" -[[package]] -name = "num-derive" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "num-derive" version = "0.4.2" @@ -7504,7 +7493,7 @@ dependencies = [ "jni", "ndk 0.8.0", "ndk-context", - "num-derive 0.4.2", + "num-derive", "num-traits", "oboe-sys", ] @@ -7741,7 +7730,7 @@ dependencies = [ "either", "log", "nalgebra", - "num-derive 0.4.2", + "num-derive", "num-traits", "ordered-float", "rstar", @@ -8520,7 +8509,7 @@ dependencies = [ "downcast-rs", "log", "nalgebra", - "num-derive 0.4.2", + "num-derive", "num-traits", "ordered-float", "parry3d-f64", @@ -8550,7 +8539,7 @@ dependencies = [ "maybe-rayon", "new_debug_unreachable", "noop_proc_macro", - "num-derive 0.4.2", + "num-derive", "num-traits", "once_cell", "paste", diff --git a/crates/avatar/src/avatar_texture.rs b/crates/avatar/src/avatar_texture.rs index 22d34933..a0f8f6ea 100644 --- a/crates/avatar/src/avatar_texture.rs +++ b/crates/avatar/src/avatar_texture.rs @@ -65,7 +65,7 @@ pub struct BoothInstance { #[derive(Resource, Default)] pub struct LiveBooths(Vec>); -impl<'w, 's> PhotoBooth<'w, 's> { +impl PhotoBooth<'_, '_> { pub fn spawn_booth( &mut self, render_layers: RenderLayers, diff --git a/crates/collectibles/src/lib.rs b/crates/collectibles/src/lib.rs index d0f71d8f..fc29a6fa 100644 --- a/crates/collectibles/src/lib.rs +++ b/crates/collectibles/src/lib.rs @@ -146,7 +146,7 @@ pub enum CollectibleError { const RETAIN_TICKS: u32 = 3; -impl<'w, 's, T: CollectibleType> CollectibleManager<'w, 's, T> { +impl CollectibleManager<'_, '_, T> { pub fn get_hash( &mut self, urn: impl AsRef>, diff --git a/crates/common/src/util.rs b/crates/common/src/util.rs index 30445bde..9d0aa51a 100644 --- a/crates/common/src/util.rs +++ b/crates/common/src/util.rs @@ -346,7 +346,7 @@ pub trait ModifyComponentExt { ) -> &mut Self; } -impl<'a> ModifyComponentExt for EntityCommands<'a> { +impl ModifyComponentExt for EntityCommands<'_> { fn modify_component( &mut self, func: F, @@ -396,7 +396,7 @@ pub trait ModifyDefaultComponentExt { ) -> &mut Self; } -impl<'a> ModifyDefaultComponentExt for EntityCommands<'a> { +impl ModifyDefaultComponentExt for EntityCommands<'_> { fn default_and_modify_component< C: Component + Default, F: FnOnce(&mut C) + Send + Sync + 'static, @@ -423,7 +423,7 @@ pub struct VolumePanning<'w, 's> { receiver: Query<'w, 's, &'static GlobalTransform, With>, } -impl<'w, 's> VolumePanning<'w, 's> { +impl VolumePanning<'_, '_> { pub fn volume_and_panning(&self, translation: Vec3) -> (f32, f32) { let Ok(receiver) = self.receiver.get_single() else { return (1.0, 0.5); diff --git a/crates/comms/src/lib.rs b/crates/comms/src/lib.rs index bdfbbeeb..54e04d48 100644 --- a/crates/comms/src/lib.rs +++ b/crates/comms/src/lib.rs @@ -154,7 +154,7 @@ pub struct AdapterManager<'w, 's> { _p: PhantomData<&'s ()>, } -impl<'w, 's> AdapterManager<'w, 's> { +impl AdapterManager<'_, '_> { pub fn connect(&mut self, adapter: &str) -> Option { let Some((protocol, address)) = adapter.split_once(':') else { warn!("unrecognised adapter string: {adapter}"); diff --git a/crates/comms/src/profile.rs b/crates/comms/src/profile.rs index 35f53e75..a87fbf93 100644 --- a/crates/comms/src/profile.rs +++ b/crates/comms/src/profile.rs @@ -69,7 +69,7 @@ pub struct ProfileManager<'w, 's> { pub struct ProfileMissingError; -impl<'w, 's> ProfileManager<'w, 's> { +impl ProfileManager<'_, '_> { pub fn get_data( &mut self, address: Address, diff --git a/crates/dcl/Cargo.toml b/crates/dcl/Cargo.toml index ddfd84f9..4c6ce96d 100644 --- a/crates/dcl/Cargo.toml +++ b/crates/dcl/Cargo.toml @@ -32,7 +32,7 @@ deno_webidl = "0.168" deno_web = "0.199" deno_websocket = "0.173" -num-derive = "0.3" +num-derive = "0.4.2" num = "0.4" num-traits = "0.2" http = "0.2.9" diff --git a/crates/dcl/src/crdt/lww.rs b/crates/dcl/src/crdt/lww.rs index dda0885a..889f35b5 100644 --- a/crates/dcl/src/crdt/lww.rs +++ b/crates/dcl/src/crdt/lww.rs @@ -197,7 +197,7 @@ mod test { if let Some(data) = data { assert_eq!( - T::from_reader(&mut DclReader::new(&output_data)).unwrap(), + T::from_reader(&mut DclReader::new(output_data)).unwrap(), data ); } @@ -215,7 +215,7 @@ mod test { let buf = data.to_le_bytes(); let mut reader = DclReader::new(&buf); - assert_eq!(state.try_update(entity, timestamp, Some(&mut reader)), true); + assert!(state.try_update(entity, timestamp, Some(&mut reader))); assert_entry_eq(state, entity, timestamp, Some(data)); } @@ -233,11 +233,10 @@ mod test { let buf = data.to_le_bytes(); let mut reader = DclReader::new(&buf); - assert_eq!(state.try_update(entity, timestamp, Some(&mut reader)), true); + assert!(state.try_update(entity, timestamp, Some(&mut reader))); let mut reader = DclReader::new(&buf); - assert_eq!( - state.try_update(entity, timestamp, Some(&mut reader)), - false + assert!( + !state.try_update(entity, timestamp, Some(&mut reader)) ); assert_entry_eq(state, entity, timestamp, Some(data)); @@ -256,13 +255,13 @@ mod test { let buf = data.to_le_bytes(); let mut reader = DclReader::new(&buf); - assert_eq!(state.try_update(entity, timestamp, Some(&mut reader)), true); + assert!(state.try_update(entity, timestamp, Some(&mut reader))); let timestamp = SceneCrdtTimestamp(1); let newer_data = 999u32; let buf = newer_data.to_le_bytes(); let mut reader = DclReader::new(&buf); - assert_eq!(state.try_update(entity, timestamp, Some(&mut reader)), true); + assert!(state.try_update(entity, timestamp, Some(&mut reader))); assert_entry_eq(state, entity, timestamp, Some(newer_data)); } @@ -280,15 +279,14 @@ mod test { let buf = data.to_le_bytes(); let mut reader = DclReader::new(&buf); - assert_eq!(state.try_update(entity, timestamp, Some(&mut reader)), true); + assert!(state.try_update(entity, timestamp, Some(&mut reader))); let older_timestamp = SceneCrdtTimestamp(0); let newer_data = 999u32; let buf = newer_data.to_le_bytes(); let mut reader = DclReader::new(&buf); - assert_eq!( - state.try_update(entity, older_timestamp, Some(&mut reader)), - false + assert!( + !state.try_update(entity, older_timestamp, Some(&mut reader)) ); assert_entry_eq(state, entity, timestamp, Some(data)); @@ -307,12 +305,12 @@ mod test { let buf = data.to_le_bytes(); let mut reader = DclReader::new(&buf); - assert_eq!(state.try_update(entity, timestamp, Some(&mut reader)), true); + assert!(state.try_update(entity, timestamp, Some(&mut reader))); let higher_data = 2u32; let buf = higher_data.to_le_bytes(); let mut reader = DclReader::new(&buf); - assert_eq!(state.try_update(entity, timestamp, Some(&mut reader)), true); + assert!(state.try_update(entity, timestamp, Some(&mut reader))); assert_entry_eq(state, entity, timestamp, Some(higher_data)); } @@ -330,9 +328,9 @@ mod test { let buf = data.to_le_bytes(); let mut reader = DclReader::new(&buf); - assert_eq!(state.try_update(entity, timestamp, Some(&mut reader)), true); + assert!(state.try_update(entity, timestamp, Some(&mut reader))); - assert_eq!(state.try_update(entity, timestamp, None), false); + assert!(!state.try_update(entity, timestamp, None)); assert_entry_eq(state, entity, timestamp, Some(data)); } @@ -350,10 +348,10 @@ mod test { let buf = data.to_le_bytes(); let mut reader = DclReader::new(&buf); - assert_eq!(state.try_update(entity, timestamp, Some(&mut reader)), true); + assert!(state.try_update(entity, timestamp, Some(&mut reader))); let newer_timestamp = SceneCrdtTimestamp(2); - assert_eq!(state.try_update(entity, newer_timestamp, None), true); + assert!(state.try_update(entity, newer_timestamp, None)); assert_entry_eq(state, entity, newer_timestamp, Option::::None); } @@ -371,11 +369,11 @@ mod test { let buf = data.to_le_bytes(); let mut reader = DclReader::new(&buf); - assert_eq!(state.try_update(entity, timestamp, Some(&mut reader)), true); + assert!(state.try_update(entity, timestamp, Some(&mut reader))); let newer_timestamp = SceneCrdtTimestamp(2); - assert_eq!(state.try_update(entity, newer_timestamp, None), true); - assert_eq!(state.try_update(entity, newer_timestamp, None), false); + assert!(state.try_update(entity, newer_timestamp, None)); + assert!(!state.try_update(entity, newer_timestamp, None)); assert_entry_eq(state, entity, newer_timestamp, Option::::None); } @@ -393,17 +391,16 @@ mod test { let buf = data.to_le_bytes(); let mut reader = DclReader::new(&buf); - assert_eq!(state.try_update(entity, timestamp, Some(&mut reader)), true); + assert!(state.try_update(entity, timestamp, Some(&mut reader))); let newer_timestamp = SceneCrdtTimestamp(2); - assert_eq!(state.try_update(entity, newer_timestamp, None), true); + assert!(state.try_update(entity, newer_timestamp, None)); let data = 3u32; let buf = data.to_le_bytes(); let mut reader = DclReader::new(&buf); - assert_eq!( - state.try_update(entity, newer_timestamp, Some(&mut reader)), - true + assert!( + state.try_update(entity, newer_timestamp, Some(&mut reader)) ); assert_entry_eq(state, entity, newer_timestamp, Some(data)); @@ -421,13 +418,12 @@ mod test { let buf = 1231u32.to_le_bytes(); let mut reader = DclReader::new(&buf); - assert_eq!(state.try_update(entity, timestamp, Some(&mut reader)), true); + assert!(state.try_update(entity, timestamp, Some(&mut reader))); let newer_timestamp = SceneCrdtTimestamp(2); let mut reader = DclReader::new(&[]); - assert_eq!( - state.try_update(entity, newer_timestamp, Some(&mut reader)), - true + assert!( + state.try_update(entity, newer_timestamp, Some(&mut reader)) ); assert_entry_eq(state, entity, newer_timestamp, Some(Vec::::default())); diff --git a/crates/dcl_component/src/writer.rs b/crates/dcl_component/src/writer.rs index a3f97d01..6296f495 100644 --- a/crates/dcl_component/src/writer.rs +++ b/crates/dcl_component/src/writer.rs @@ -54,7 +54,7 @@ impl<'a> DclWriter<'a> { } } -impl<'a> Deref for DclWriter<'a> { +impl Deref for DclWriter<'_> { type Target = [u8]; fn deref(&self) -> &Self::Target { @@ -73,7 +73,7 @@ pub trait ToDclWriter { } } -unsafe impl<'a> prost::bytes::BufMut for DclWriter<'a> { +unsafe impl prost::bytes::BufMut for DclWriter<'_> { fn remaining_mut(&self) -> usize { self.buffer.remaining_mut() } diff --git a/crates/imposters/src/bake_scene.rs b/crates/imposters/src/bake_scene.rs index cdb84e67..95572b35 100644 --- a/crates/imposters/src/bake_scene.rs +++ b/crates/imposters/src/bake_scene.rs @@ -634,7 +634,7 @@ fn pick_imposter_to_bake( for x in imposter.parcel.x..imposter.parcel.x + size { for y in imposter.parcel.y..imposter.parcel.y + size { if let Some(PointerResult::Exists { hash, .. }) = - scene_pointers.get(&IVec2::new(x, y)) + scene_pointers.get(IVec2::new(x, y)) { if live_scenes.0.get(hash).is_some() { // skip due to live scene diff --git a/crates/imposters/src/render.rs b/crates/imposters/src/render.rs index 1ec08456..fa42f336 100644 --- a/crates/imposters/src/render.rs +++ b/crates/imposters/src/render.rs @@ -136,7 +136,7 @@ pub struct ImposterLookup<'w, 's> { asset_server: Res<'w, AssetServer>, } -impl<'w, 's> ImposterLookup<'w, 's> { +impl ImposterLookup<'_, '_> { fn imposter_state( entities: &HashMap<(IVec2, usize, bool), Entity>, imposters: &Query<(Option<&ImposterMissing>, Option<&Children>)>, diff --git a/crates/input_manager/src/lib.rs b/crates/input_manager/src/lib.rs index 2f52ee0c..be30de08 100644 --- a/crates/input_manager/src/lib.rs +++ b/crates/input_manager/src/lib.rs @@ -73,7 +73,7 @@ pub struct InputManager<'w> { should_accept: Res<'w, AcceptInput>, } -impl<'w> InputManager<'w> { +impl InputManager<'_> { pub fn any_just_acted(&self) -> bool { self.mouse_input.get_just_pressed().len() != 0 || self.mouse_input.get_just_released().len() != 0 diff --git a/crates/ipfs/src/lib.rs b/crates/ipfs/src/lib.rs index 846f35f8..e5867479 100644 --- a/crates/ipfs/src/lib.rs +++ b/crates/ipfs/src/lib.rs @@ -236,7 +236,7 @@ pub struct IpfsAssetServer<'w, 's> { _p: PhantomData<&'s ()>, } -impl<'w, 's> IpfsAssetServer<'w, 's> { +impl IpfsAssetServer<'_, '_> { pub fn load_content_file( &self, file_path: &str, diff --git a/crates/scene_runner/src/bounds_calc.rs b/crates/scene_runner/src/bounds_calc.rs index 8e6ccee1..ddcfd625 100644 --- a/crates/scene_runner/src/bounds_calc.rs +++ b/crates/scene_runner/src/bounds_calc.rs @@ -137,6 +137,7 @@ mod test { } } + #[allow(clippy::single_element_loop)] for test in [vec![ IVec2::new(0, 0), IVec2::new(1, 1), diff --git a/crates/scene_runner/src/gltf_resolver.rs b/crates/scene_runner/src/gltf_resolver.rs index 620c58da..517d9d3b 100644 --- a/crates/scene_runner/src/gltf_resolver.rs +++ b/crates/scene_runner/src/gltf_resolver.rs @@ -16,7 +16,7 @@ pub struct GltfResolver<'w, 's> { gltfs: Res<'w, Assets>, } -impl<'w, 's> GltfResolver<'w, 's> { +impl GltfResolver<'_, '_> { pub fn begin_frame(&mut self) { *self.prev_pending_gltfs = std::mem::take(&mut *self.pending_gltfs); } @@ -61,7 +61,7 @@ pub struct GltfMeshResolver<'w, 's> { gltf_meshes: Res<'w, Assets>, } -impl<'w, 's> GltfMeshResolver<'w, 's> { +impl GltfMeshResolver<'_, '_> { pub fn begin_frame(&mut self) { self.gltf_resolver.begin_frame(); } @@ -119,7 +119,7 @@ pub struct GltfMaterialResolver<'w, 's> { std_materials: Res<'w, Assets>, } -impl<'w, 's> GltfMaterialResolver<'w, 's> { +impl GltfMaterialResolver<'_, '_> { pub fn begin_frame(&mut self) { self.gltf_resolver.begin_frame(); } diff --git a/crates/scene_runner/src/lib.rs b/crates/scene_runner/src/lib.rs index ed25e5ed..5a456a58 100644 --- a/crates/scene_runner/src/lib.rs +++ b/crates/scene_runner/src/lib.rs @@ -133,7 +133,7 @@ pub struct Toaster<'w, 's> { _p: PhantomData<&'s ()>, } -impl<'w, 's> Toaster<'w, 's> { +impl Toaster<'_, '_> { pub fn do_add_toast( &mut self, key: impl Into, @@ -467,7 +467,7 @@ pub fn vec3_to_parcel(position: Vec3) -> IVec2 { .as_ivec2() } -impl<'w, 's> ContainingScene<'w, 's> { +impl ContainingScene<'_, '_> { // just the parcel at the position pub fn get_parcel_position(&self, position: Vec3) -> Option { let parcel = vec3_to_parcel(position); diff --git a/crates/scene_runner/src/permissions.rs b/crates/scene_runner/src/permissions.rs index b13eb9b3..e917ed1b 100644 --- a/crates/scene_runner/src/permissions.rs +++ b/crates/scene_runner/src/permissions.rs @@ -72,7 +72,7 @@ pub struct Permission<'w, 's, T: Send + Sync + 'static> { pub toaster: Toaster<'w, 's>, } -impl<'w, 's, T: Send + Sync + 'static> Permission<'w, 's, T> { +impl Permission<'_, '_, T> { // in scene, hash, title, is_portable fn get_scene_info(&self, scene: Entity) -> Option<(bool, &str, &str, bool)> { let in_scene = self diff --git a/crates/scene_runner/src/primary_entities.rs b/crates/scene_runner/src/primary_entities.rs index 992d9487..63a2001b 100644 --- a/crates/scene_runner/src/primary_entities.rs +++ b/crates/scene_runner/src/primary_entities.rs @@ -10,7 +10,7 @@ pub struct PrimaryEntities<'w, 's> { camera: Query<'w, 's, Entity, With>, } -impl<'w, 's> PrimaryEntities<'w, 's> { +impl PrimaryEntities<'_, '_> { pub fn player(&self) -> Entity { self.player.single() } diff --git a/crates/scene_runner/src/test/mod.rs b/crates/scene_runner/src/test/mod.rs index f363e6cb..f1055829 100644 --- a/crates/scene_runner/src/test/mod.rs +++ b/crates/scene_runner/src/test/mod.rs @@ -57,7 +57,7 @@ use super::{initialize_scene::SceneLoading, PrimaryUser}; pub struct TestPlugins; -pub static LOG_ADDED: Lazy> = Lazy::new(|| Default::default()); +pub static LOG_ADDED: Lazy> = Lazy::new(Default::default); impl PluginGroup for TestPlugins { fn build(self) -> PluginGroupBuilder { @@ -78,13 +78,13 @@ impl PluginGroup for TestPlugins { builder .add(TaskPoolPlugin::default()) - .add(TypeRegistrationPlugin::default()) - .add(FrameCountPlugin::default()) - .add(TimePlugin::default()) + .add(TypeRegistrationPlugin) + .add(FrameCountPlugin) + .add(TimePlugin) .add(ScheduleRunnerPlugin::default()) - .add(TransformPlugin::default()) - .add(HierarchyPlugin::default()) - .add(DiagnosticsPlugin::default()) + .add(TransformPlugin) + .add(HierarchyPlugin) + .add(DiagnosticsPlugin) .add(IpfsIoPlugin { preview: false, assets_root: test_path.to_str().map(ToOwned::to_owned), @@ -451,8 +451,7 @@ fn cyclic_recovery() { let mut crdt_store = CrdtStore::default(); - for ix in 0..4 { - let (dcl_entity, timestamp, data) = &messages[ix]; + for (dcl_entity, timestamp, data) in messages.iter().take(4) { let (mut scene_context, mut crdt_state) = app .world_mut() .query::<( @@ -467,7 +466,7 @@ fn cyclic_recovery() { } // add next message - let reader = &mut DclReader::new(&data); + let reader = &mut DclReader::new(data); crdt_store.try_update( SceneComponentId::TRANSFORM, CrdtType::LWW_ENT, diff --git a/crates/scene_runner/src/update_world/material.rs b/crates/scene_runner/src/update_world/material.rs index a702f0e0..b72a0f30 100644 --- a/crates/scene_runner/src/update_world/material.rs +++ b/crates/scene_runner/src/update_world/material.rs @@ -237,7 +237,7 @@ pub struct ResolvedTexture { pub camera_target: Option, } -impl<'w, 's> TextureResolver<'w, 's> { +impl TextureResolver<'_, '_> { pub fn resolve_texture( &mut self, scene: &RendererSceneContext, diff --git a/crates/scene_runner/src/update_world/transform_and_parent.rs b/crates/scene_runner/src/update_world/transform_and_parent.rs index b880fae1..3e773006 100644 --- a/crates/scene_runner/src/update_world/transform_and_parent.rs +++ b/crates/scene_runner/src/update_world/transform_and_parent.rs @@ -292,7 +292,7 @@ pub struct TransformHelperPub<'w, 's> { pub transform_query: Query<'w, 's, &'static Transform>, } -impl<'w, 's> TransformHelperPub<'w, 's> { +impl TransformHelperPub<'_, '_> { /// Computes the [`GlobalTransform`] of the given entity from the [`Transform`] component on it and its ancestors. pub fn compute_global_transform( &self, diff --git a/crates/social/src/client.rs b/crates/social/src/client.rs index 14043709..113b2de6 100644 --- a/crates/social/src/client.rs +++ b/crates/social/src/client.rs @@ -785,7 +785,7 @@ mod test { thread::sleep(Duration::from_secs(1)); } - return None; + None } #[test] diff --git a/crates/system_ui/src/chat/conversation_manager.rs b/crates/system_ui/src/chat/conversation_manager.rs index 369d90a0..1db5c804 100644 --- a/crates/system_ui/src/chat/conversation_manager.rs +++ b/crates/system_ui/src/chat/conversation_manager.rs @@ -34,7 +34,7 @@ pub struct ConversationManager<'w, 's> { >, } -impl<'w, 's> ConversationManager<'w, 's> { +impl ConversationManager<'_, '_> { fn existing_bubble( &self, container: Entity, diff --git a/crates/ui_core/src/button.rs b/crates/ui_core/src/button.rs index 7f0f955e..5dbf0145 100644 --- a/crates/ui_core/src/button.rs +++ b/crates/ui_core/src/button.rs @@ -319,7 +319,7 @@ pub struct TabManager<'w, 's> { commands: Commands<'w, 's>, } -impl<'w, 's> TabManager<'w, 's> { +impl TabManager<'_, '_> { pub fn set_selected(&mut self, tab_entity: Entity, index: Option) { let Ok(mut tab) = self.tabs.get_mut(tab_entity) else { warn!("no tab"); diff --git a/crates/ui_core/src/combo_box.rs b/crates/ui_core/src/combo_box.rs index 7aae1d71..1620b446 100644 --- a/crates/ui_core/src/combo_box.rs +++ b/crates/ui_core/src/combo_box.rs @@ -85,7 +85,7 @@ pub struct TargetCameraProps { pub scale_factor: f32, } -impl<'w, 's> TargetCameraHelper<'w, 's> { +impl TargetCameraHelper<'_, '_> { fn get_props(&self, e: Entity) -> Option { let target_camera = self.target_camera.get(e).ok().cloned(); let (window_ref, texture_ref) = match &target_camera { diff --git a/crates/ui_core/src/ui_builder.rs b/crates/ui_core/src/ui_builder.rs index e91b8211..c8288ded 100644 --- a/crates/ui_core/src/ui_builder.rs +++ b/crates/ui_core/src/ui_builder.rs @@ -5,7 +5,7 @@ pub trait SpawnSpacer { fn spacer(&mut self) -> EntityCommands<'_>; } -impl<'a> SpawnSpacer for ChildBuilder<'a> { +impl SpawnSpacer for ChildBuilder<'_> { fn spacer(&mut self) -> EntityCommands<'_> { self.spawn(NodeBundle { style: Style { @@ -17,7 +17,7 @@ impl<'a> SpawnSpacer for ChildBuilder<'a> { } } -impl<'a> SpawnSpacer for TryChildBuilder<'a> { +impl SpawnSpacer for TryChildBuilder<'_> { fn spacer(&mut self) -> EntityCommands<'_> { self.spawn(NodeBundle { style: Style { diff --git a/crates/user_input/src/camera.rs b/crates/user_input/src/camera.rs index 6c50d9d4..4a4ce6da 100644 --- a/crates/user_input/src/camera.rs +++ b/crates/user_input/src/camera.rs @@ -27,7 +27,6 @@ use ui_core::scrollable::UsedScrollWheel; use crate::TRANSITION_TIME; #[allow(clippy::too_many_arguments, clippy::type_complexity)] - pub struct CinematicInitialData { base_yaw: f32, base_pitch: f32, @@ -54,7 +53,7 @@ pub enum ClickState { Released, } -impl<'w, 's> MouseInteractionState<'w, 's> { +impl MouseInteractionState<'_, '_> { pub fn update(&mut self, button: MouseButton) -> ClickState { let state = self.states.entry(button).or_default(); diff --git a/src/main.rs b/src/main.rs index 66f0d436..99e17bbd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -175,10 +175,11 @@ fn main() { .value_from_str("--bake") .ok() .map(|bake: String| match bake.to_lowercase().chars().next() { - None | Some("f") => SceneImposterBake::FullSpeed, - Some("h") => SceneImposterBake::HalfSpeed, - Some("q") => SceneImposterBake::QuarterSpeed, - Some("o") => SceneImposterBake::Off, + None | Some('f') => SceneImposterBake::FullSpeed, + Some('h') => SceneImposterBake::HalfSpeed, + Some('q') => SceneImposterBake::QuarterSpeed, + Some('o') => SceneImposterBake::Off, + _ => panic!(), }) .unwrap_or(SceneImposterBake::Off), scene_imposter_distances: args