diff --git a/src/image_manager.rs b/src/image_manager.rs index 664cc21..b405f56 100644 --- a/src/image_manager.rs +++ b/src/image_manager.rs @@ -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) diff --git a/src/main.rs b/src/main.rs index a6da4a9..23294cb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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)); diff --git a/src/pix/canvas.rs b/src/pix/canvas.rs index ca66fd4..a4b54db 100644 --- a/src/pix/canvas.rs +++ b/src/pix/canvas.rs @@ -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));