1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-02 06:40:06 -04:00

lint: fix lints appearing in rust stable currently (#7118)

* [x] I have followed the instructions in the PR template
This commit is contained in:
Nicolas
2025-06-11 17:38:06 +02:00
committed by GitHub
parent cfb10a04f5
commit 9f9153805d
9 changed files with 26 additions and 26 deletions

View File

@@ -3511,9 +3511,10 @@ impl Context {
// Try most recently added loaders first (hence `.rev()`)
for loader in bytes_loaders.iter().rev() {
match loader.load(self, uri) {
Err(load::LoadError::NotSupported) => continue,
result => return result,
let result = loader.load(self, uri);
match result {
Err(load::LoadError::NotSupported) => {}
_ => return result,
}
}
@@ -3554,10 +3555,9 @@ impl Context {
// Try most recently added loaders first (hence `.rev()`)
for loader in image_loaders.iter().rev() {
match loader.load(self, uri, size_hint) {
Err(load::LoadError::NotSupported) => continue,
Err(load::LoadError::NotSupported) => {}
Err(load::LoadError::FormatNotSupported { detected_format }) => {
format = format.or(detected_format);
continue;
}
result => return result,
}
@@ -3600,7 +3600,7 @@ impl Context {
// Try most recently added loaders first (hence `.rev()`)
for loader in texture_loaders.iter().rev() {
match loader.load(self, uri, texture_options, size_hint) {
Err(load::LoadError::NotSupported) => continue,
Err(load::LoadError::NotSupported) => {}
result => return result,
}
}

View File

@@ -256,9 +256,7 @@ impl ViewportInfo {
/// If this is not the root viewport,
/// it is up to the user to hide this viewport the next frame.
pub fn close_requested(&self) -> bool {
self.events
.iter()
.any(|&event| event == ViewportEvent::Close)
self.events.contains(&ViewportEvent::Close)
}
/// Helper: move [`Self::events`], clone the other fields.

View File

@@ -739,7 +739,7 @@ impl WidgetInfo {
if text_value.is_empty() {
"blank".into()
} else {
text_value.to_string()
text_value.clone()
}
} else {
"blank".into()

View File

@@ -1235,7 +1235,7 @@ impl Areas {
self.visible_areas_current_frame.insert(layer_id);
self.wants_to_be_on_top.insert(layer_id);
if !self.order.iter().any(|x| *x == layer_id) {
if !self.order.contains(&layer_id) {
self.order.push(layer_id);
}
}
@@ -1256,10 +1256,10 @@ impl Areas {
self.sublayers.entry(parent).or_default().insert(child);
// Make sure the layers are in the order list:
if !self.order.iter().any(|x| *x == parent) {
if !self.order.contains(&parent) {
self.order.push(parent);
}
if !self.order.iter().any(|x| *x == child) {
if !self.order.contains(&child) {
self.order.push(child);
}
}
@@ -1268,7 +1268,7 @@ impl Areas {
self.order
.iter()
.filter(|layer| layer.order == order && !self.is_sublayer(layer))
.last()
.next_back()
.copied()
}

View File

@@ -863,9 +863,11 @@ impl TextEdit<'_> {
fn mask_if_password(is_password: bool, text: &str) -> String {
fn mask_password(text: &str) -> String {
std::iter::repeat(epaint::text::PASSWORD_REPLACEMENT_CHAR)
.take(text.chars().count())
.collect::<String>()
std::iter::repeat_n(
epaint::text::PASSWORD_REPLACEMENT_CHAR,
text.chars().count(),
)
.collect::<String>()
}
if is_password {