Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
Signed-off-by: Torstein Grindvik <torstein.grindvik@nordicsemi.no>
  • Loading branch information
torsteingrindvik committed Dec 21, 2022
1 parent 8a6781f commit 6bb3c93
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions crates/bevy_render/src/picking/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 6 additions & 8 deletions examples/animation/animated_fox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,10 @@ fn store_fox_entites(
scene_spawner: Res<SceneSpawner>,
fox_scene: Query<&SceneInstance, With<Fox>>,
) {
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;
}
}
}
Expand All @@ -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;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions examples/app/picking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,14 +327,14 @@ fn picking_text(mut pick_events: EventReader<PickedEvent>, 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;
}
}
Expand Down

0 comments on commit 6bb3c93

Please sign in to comment.