Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nightkr authored and jakobhellermann committed Oct 14, 2024
1 parent ae47c0a commit e2a853d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
10 changes: 4 additions & 6 deletions crates/bevy-inspector-egui/src/bevy_inspector/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,21 +263,19 @@ impl Filter {
});

// improves overall matching
let filter = filter.to_lowercase();

filter
filter.to_lowercase()
};

// filter kind
let is_fuzzy = {
let filter_kind_id = egui::Id::new("world ui filter fuzzy");
let mut is_fuzzy = ui.memory_mut(|mem| {
let fuzzy: &mut bool = mem.data.get_persisted_mut_or_default(filter_kind_id);
fuzzy.clone()
*fuzzy
});
ui.checkbox(&mut is_fuzzy, "Fuzzy Match");
ui.memory_mut(|mem| {
*mem.data.get_persisted_mut_or_default(filter_kind_id) = is_fuzzy.clone();
*mem.data.get_persisted_mut_or_default(filter_kind_id) = is_fuzzy;
});
is_fuzzy
};
Expand Down Expand Up @@ -366,7 +364,7 @@ fn self_or_children_satisfy_filter(
let matcher = SkimMatcherV2::default();
matcher.fuzzy_match(name.as_str(), filter).is_some()
} else {
name.to_lowercase().contains(&filter)
name.to_lowercase().contains(filter)
};
self_matches || {
world
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ pub mod quat {
.get_temp_mut_or_insert_with(id, || T::from_quat(*val))
});

let externally_changed = !intermediate.to_quat().abs_diff_eq(*val, std::f32::EPSILON);
let externally_changed = !intermediate.to_quat().abs_diff_eq(*val, f32::EPSILON);
if externally_changed {
intermediate = T::from_quat(*val);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ pub fn from_dynamic(dyn_img: DynamicImage, is_srgb: bool) -> Image {
let r = pixel[0];
let g = pixel[1];
let b = pixel[2];
let a = u16::max_value();
let a = u16::MAX;

local_data.extend_from_slice(&r.to_ne_bytes());
local_data.extend_from_slice(&g.to_ne_bytes());
Expand Down Expand Up @@ -123,7 +123,7 @@ pub fn from_dynamic(dyn_img: DynamicImage, is_srgb: bool) -> Image {
let r = pixel[0];
let g = pixel[1];
let b = pixel[2];
let a = u16::max_value();
let a = u16::MAX;

local_data.extend_from_slice(&r.to_ne_bytes());
local_data.extend_from_slice(&g.to_ne_bytes());
Expand Down

0 comments on commit e2a853d

Please sign in to comment.