From 670c07e56eae02b24f0d27898ae4c2046e66bdc0 Mon Sep 17 00:00:00 2001 From: MegaBrutal <code+git@megabrutal.com> Date: Thu, 14 Jul 2022 23:35:00 +0200 Subject: [PATCH] Get rid of warnings --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 32202b8..373a401 100644 --- a/src/main.rs +++ b/src/main.rs @@ -128,7 +128,7 @@ fn make_png(dim_x: u32, dim_y: u32, scale: u32, data: &mut dyn Iterator<Item = u return Err(ImageError::dimension_error()) } - let mut img: RgbImage = rgb_encode(ImageBuffer::new(dim_x, dim_y), data)?; + let img: RgbImage = rgb_encode(ImageBuffer::new(dim_x, dim_y), data)?; let tdim_x = dim_x * scale; let tdim_y = dim_y * scale; @@ -165,7 +165,7 @@ async fn img_pgen0(req: HttpRequest, canvas0: web::Data<Arc<Mutex<Option<Canvas> let tdim_x = 32 * scale; let tdim_y = 32 * scale; let img: RgbImage = { - let mut canvas_option = &mut *canvas0.lock().unwrap(); + let canvas_option = &mut *canvas0.lock().unwrap(); let canvas = canvas_option.take(); let canvas = rgb_encode_to_canvas(canvas.expect("Canvas doesn't exist!"), percent_decode_str(&data).into_iter().borrow_mut())?; canvas_option.insert(canvas).img.clone() -- 2.34.1