fix some clippy lints
This commit is contained in:
@@ -98,7 +98,7 @@ fn load_image(path: &str, size: (u16, u16)) -> DynamicImage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Load the image
|
// Load the image
|
||||||
let image = image::open(&path).unwrap();
|
let image = image::open(path).unwrap();
|
||||||
|
|
||||||
// Resize the image to fit the screen
|
// Resize the image to fit the screen
|
||||||
image.resize_exact(size.0 as u32, size.1 as u32, FilterType::Gaussian)
|
image.resize_exact(size.0 as u32, size.1 as u32, FilterType::Gaussian)
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ fn start(arg_handler: &ArgHandler) {
|
|||||||
|
|
||||||
// Gather facts about the host
|
// Gather facts about the host
|
||||||
let screen_size =
|
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
|
// Determine the size to use
|
||||||
let size = arg_handler.size(Some(screen_size));
|
let size = arg_handler.size(Some(screen_size));
|
||||||
|
|||||||
@@ -79,26 +79,23 @@ impl Canvas {
|
|||||||
let mut painter = Painter::new(None, area, offset, None);
|
let mut painter = Painter::new(None, area, offset, None);
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
// The painting loop
|
|
||||||
'paint: loop {
|
|
||||||
// Connect
|
// Connect
|
||||||
let client = match Client::connect(host.clone(), binary) {
|
match Client::connect(host.clone(), binary) {
|
||||||
Ok(client) => client,
|
Ok(client) => {
|
||||||
Err(e) => {
|
|
||||||
eprintln!("Painter failed to connect: {}", e);
|
|
||||||
break 'paint;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
painter.set_client(Some(client));
|
painter.set_client(Some(client));
|
||||||
|
|
||||||
// Keep painting
|
// Keep painting
|
||||||
loop {
|
loop {
|
||||||
if let Err(e) = painter.work(&rx) {
|
if let Err(e) = painter.work(&rx) {
|
||||||
println!("Painter error: {}", e);
|
println!("Painter error: {}", e);
|
||||||
break 'paint;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Err(e) => {
|
||||||
|
eprintln!("Painter failed to connect: {}", e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// Sleep for half a second before restarting the painter
|
// Sleep for half a second before restarting the painter
|
||||||
sleep(Duration::from_millis(500));
|
sleep(Duration::from_millis(500));
|
||||||
|
|||||||
Reference in New Issue
Block a user