Fix clippy lints for Rust 1.88 🎉

This commit is contained in:
Héctor Ramón Jiménez 2025-06-27 00:00:49 +02:00
parent c952ea8485
commit 8578a1362b
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
8 changed files with 16 additions and 17 deletions

View file

@ -166,7 +166,7 @@ impl<Message> canvas::Program<Message> for Clock {
let y = radius * angle.0.sin(); let y = radius * angle.0.sin();
frame.fill_text(canvas::Text { frame.fill_text(canvas::Text {
content: format!("{}", hour), content: format!("{hour}"),
size: (radius / 5.0).into(), size: (radius / 5.0).into(),
position: Point::new(x * 0.82, y * 0.82), position: Point::new(x * 0.82, y * 0.82),
color: palette.secondary.strong.text, color: palette.secondary.strong.text,

View file

@ -161,7 +161,7 @@ impl Example {
impl Window { impl Window {
fn new(count: usize) -> Self { fn new(count: usize) -> Self {
Self { Self {
title: format!("Window_{}", count), title: format!("Window_{count}"),
scale_input: "1.0".to_string(), scale_input: "1.0".to_string(),
current_scale: 1.0, current_scale: 1.0,
theme: Theme::ALL[count % Theme::ALL.len()].clone(), theme: Theme::ALL[count % Theme::ALL.len()].clone(),

View file

@ -174,7 +174,7 @@ impl Example {
|png_result| match png_result { |png_result| match png_result {
Ok(path) => format!("Png saved as: {path:?}!"), Ok(path) => format!("Png saved as: {path:?}!"),
Err(PngError(error)) => { Err(PngError(error)) => {
format!("Png could not be saved due to:\n{}", error) format!("Png could not be saved due to:\n{error}")
} }
}, },
); );

View file

@ -613,12 +613,11 @@ mod toast {
&self.viewport, &self.viewport,
renderer, renderer,
) )
.max( .max(if cursor.is_over(layout.bounds()) {
cursor mouse::Interaction::Idle
.is_over(layout.bounds()) } else {
.then_some(mouse::Interaction::Idle) Default::default()
.unwrap_or_default(), })
)
}) })
.max() .max()
.unwrap_or_default() .unwrap_or_default()

View file

@ -76,7 +76,7 @@ impl Tour {
Screen::End => "End", Screen::End => "End",
}; };
format!("{} - Iced", screen) format!("{screen} - Iced")
} }
fn update(&mut self, event: Message) { fn update(&mut self, event: Message) {

View file

@ -96,7 +96,7 @@ impl Compositor {
let adapter = instance let adapter = instance
.request_adapter(&adapter_options) .request_adapter(&adapter_options)
.await .await
.ok_or(Error::NoAdapterFound(format!("{:?}", adapter_options)))?; .ok_or(Error::NoAdapterFound(format!("{adapter_options:?}")))?;
log::info!("Selected: {:#?}", adapter.get_info()); log::info!("Selected: {:#?}", adapter.get_info());

View file

@ -297,11 +297,11 @@ where
} }
fn drag_enabled(&self) -> bool { fn drag_enabled(&self) -> bool {
self.internal if self.internal.maximized().is_none() {
.maximized() self.on_drag.is_some()
.is_none() } else {
.then(|| self.on_drag.is_some()) Default::default()
.unwrap_or_default() }
} }
fn grid_interaction( fn grid_interaction(

View file

@ -810,7 +810,7 @@ async fn run_instance<P>(
Err(error) => match error { Err(error) => match error {
// This is an unrecoverable error. // This is an unrecoverable error.
compositor::SurfaceError::OutOfMemory => { compositor::SurfaceError::OutOfMemory => {
panic!("{:?}", error); panic!("{error:?}");
} }
_ => { _ => {
present_span.finish(); present_span.finish();