From b716401217c6414a0caff17d16339480d15b0a4e Mon Sep 17 00:00:00 2001 From: Jakub Wieczorek Date: Fri, 5 Jul 2019 00:04:39 +0200 Subject: [PATCH] Fix warnings caused by unnecessary `mut` qualifiers (#735) --- components/imageproc/src/lib.rs | 2 +- components/library/src/library.rs | 2 +- components/utils/src/de.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/imageproc/src/lib.rs b/components/imageproc/src/lib.rs index 745d40a1..7385efcb 100644 --- a/components/imageproc/src/lib.rs +++ b/components/imageproc/src/lib.rs @@ -300,7 +300,7 @@ impl ImageOp { match self.format { Format::Png => { - let mut enc = PNGEncoder::new(&mut f); + let enc = PNGEncoder::new(&mut f); enc.encode(&img.raw_pixels(), img_w, img_h, img.color())?; } Format::Jpeg(q) => { diff --git a/components/library/src/library.rs b/components/library/src/library.rs index c724a2ee..9cd7555c 100644 --- a/components/library/src/library.rs +++ b/components/library/src/library.rs @@ -139,7 +139,7 @@ impl Library { let parent_is_transparent; // We need to get a reference to a section later so keep the scope of borrowing small { - let mut section = self.sections.get_mut(*section_key).unwrap(); + let section = self.sections.get_mut(*section_key).unwrap(); section.pages.push(key); parent_is_transparent = section.meta.transparent; } diff --git a/components/utils/src/de.rs b/components/utils/src/de.rs index 27259cce..e6ff63db 100644 --- a/components/utils/src/de.rs +++ b/components/utils/src/de.rs @@ -40,7 +40,7 @@ pub fn fix_toml_dates(table: Map) -> Value { for (key, value) in table { match value { - Value::Object(mut o) => { + Value::Object(o) => { new.insert(key, convert_toml_date(o)); } _ => {