diff --git a/crates/bevy_render/src/picking/mod.rs b/crates/bevy_render/src/picking/mod.rs index 52f3e2f2b39b5d..f38e4fa926c4d4 100644 --- a/crates/bevy_render/src/picking/mod.rs +++ b/crates/bevy_render/src/picking/mod.rs @@ -131,8 +131,8 @@ impl PickingTextures { /// The clear color which should be used to clear picking textures. /// Picking textures use a single u32 value for each pixel. - /// This color clears that with u32::MAX. - /// This allows all entity index values below u32::MAX to be valid. + /// This color clears that with `u32::MAX`. + /// This allows all entity index values below `u32::MAX` to be valid. pub fn clear_color() -> wgpu::Color { Color::Rgba { red: f32::MAX, diff --git a/examples/animation/animated_fox.rs b/examples/animation/animated_fox.rs index 926b5a8865e6e8..e8e536348522b2 100644 --- a/examples/animation/animated_fox.rs +++ b/examples/animation/animated_fox.rs @@ -162,12 +162,10 @@ fn store_fox_entites( scene_spawner: Res, fox_scene: Query<&SceneInstance, With>, ) { - if let Some(id) = fox_scene.get_single().ok() { - if !**done { - if scene_spawner.instance_is_ready(**id) { - **fox_entities = HashSet::from_iter(scene_spawner.iter_instance_entities(**id)); - **done = true; - } + if let Ok(id) = fox_scene.get_single() { + if !**done && scene_spawner.instance_is_ready(**id) { + **fox_entities = HashSet::from_iter(scene_spawner.iter_instance_entities(**id)); + **done = true; } } } @@ -192,11 +190,11 @@ fn picking( match event { PickedEventVariant::Picked => { let mut light = light.single_mut(); - light.color = LIGHT_FOX_PICKED + light.color = LIGHT_FOX_PICKED; } PickedEventVariant::Unpicked => { let mut light = light.single_mut(); - light.color = LIGHT_FOX_UNPICKED + light.color = LIGHT_FOX_UNPICKED; } } } diff --git a/examples/app/picking.rs b/examples/app/picking.rs index 1758bcf0562e93..516551977f7d70 100644 --- a/examples/app/picking.rs +++ b/examples/app/picking.rs @@ -327,14 +327,14 @@ fn picking_text(mut pick_events: EventReader, mut texts: Query<&mut match event { PickedEventVariant::Picked => { if let Ok(mut text) = texts.get_mut(*entity) { - for section in text.sections.iter_mut() { + for section in &mut text.sections { section.style.color = COLOR_HOVERED; } } } PickedEventVariant::Unpicked => { if let Ok(mut text) = texts.get_mut(*entity) { - for section in text.sections.iter_mut() { + for section in &mut text.sections { section.style.color = COLOR_NORMAL; } }