fix some clippy lints

This commit is contained in:
Johann150
2023-12-29 00:58:29 +01:00
parent cbdbe6b207
commit f8e6dc7de7
3 changed files with 16 additions and 19 deletions

View File

@@ -98,7 +98,7 @@ fn load_image(path: &str, size: (u16, u16)) -> DynamicImage {
}
// Load the image
let image = image::open(&path).unwrap();
let image = image::open(path).unwrap();
// Resize the image to fit the screen
image.resize_exact(size.0 as u32, size.1 as u32, FilterType::Gaussian)

View File

@@ -32,7 +32,7 @@ fn start(arg_handler: &ArgHandler) {
// Gather facts about the host
let screen_size =
gather_host_facts(&arg_handler).expect("Failed to gather facts about pixelflut server");
gather_host_facts(arg_handler).expect("Failed to gather facts about pixelflut server");
// Determine the size to use
let size = arg_handler.size(Some(screen_size));

View File

@@ -79,26 +79,23 @@ impl Canvas {
let mut painter = Painter::new(None, area, offset, None);
loop {
// The painting loop
'paint: loop {
// Connect
let client = match Client::connect(host.clone(), binary) {
Ok(client) => client,
Err(e) => {
eprintln!("Painter failed to connect: {}", e);
break 'paint;
}
};
painter.set_client(Some(client));
// Connect
match Client::connect(host.clone(), binary) {
Ok(client) => {
painter.set_client(Some(client));
// Keep painting
loop {
if let Err(e) = painter.work(&rx) {
println!("Painter error: {}", e);
break 'paint;
// Keep painting
loop {
if let Err(e) = painter.work(&rx) {
println!("Painter error: {}", e);
break;
}
}
}
}
Err(e) => {
eprintln!("Painter failed to connect: {}", e);
}
};
// Sleep for half a second before restarting the painter
sleep(Duration::from_millis(500));