diff options
author | Hubert Figuière <hub@figuiere.net> | 2024-01-01 23:41:26 -0500 |
---|---|---|
committer | Hubert Figuière <hub@figuiere.net> | 2024-01-01 23:49:02 -0500 |
commit | 8932b91179786e41b1b58f727527b2a83d10b5ee (patch) | |
tree | ebdf44d0e59839c464a02d4b65590b1fa6d6ebb9 | |
parent | 8fdb9106e3ad70a1a7881ab0c9acecc6455bbe96 (diff) |
clippy: Fix some clippy warnings
Signed-off-by: Hubert Figuière <hub@figuiere.net>
-rw-r--r-- | src/canon/crw/ciff/container.rs | 8 | ||||
-rw-r--r-- | src/decompress.rs | 5 | ||||
-rw-r--r-- | src/tiff/dir.rs | 4 |
3 files changed, 8 insertions, 9 deletions
diff --git a/src/canon/crw/ciff/container.rs b/src/canon/crw/ciff/container.rs index b0265e2..65f9cc5 100644 --- a/src/canon/crw/ciff/container.rs +++ b/src/canon/crw/ciff/container.rs @@ -2,7 +2,7 @@ /* * libopenraw - canon/crw/ciff/container.rs * - * Copyright (C) 2022-2023 Hubert Figuière + * Copyright (C) 2022-2024 Hubert Figuière * * This library is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -130,9 +130,9 @@ fn translate_camera_settings(_: &RecordEntry, container: &Container, _: u16) -> 3 => 3, // Aperture Priority 4 => 1, // Manual 5 => 5, // DoF - 6 | // M-Dep - 7 | // Bulb - 8 => 0, // Flexible + // 6 M-Dep + // 7 Bulb + 6..=8 => 0, // Flexible _ => 0, }; diff --git a/src/decompress.rs b/src/decompress.rs index b20e619..0573ec5 100644 --- a/src/decompress.rs +++ b/src/decompress.rs @@ -2,7 +2,7 @@ /* * libopenraw - decompress.rs * - * Copyright (C) 2022-2023 Hubert Figuière + * Copyright (C) 2022-2024 Hubert Figuière * * This library is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -209,8 +209,7 @@ pub(crate) fn unpack_from_reader( } }; log::debug!("Block size = {}", block_size); - let mut block = Vec::new(); - block.resize(block_size, 0); + let mut block = vec![0; block_size]; let out_size = width as usize * height as usize; let mut out_data = Vec::with_capacity(out_size); let mut fetched = 0_usize; diff --git a/src/tiff/dir.rs b/src/tiff/dir.rs index accf1ff..9a3abf4 100644 --- a/src/tiff/dir.rs +++ b/src/tiff/dir.rs @@ -2,7 +2,7 @@ /* * libopenraw - tiff/dir.rs * - * Copyright (C) 2022-2023 Hubert Figuière + * Copyright (C) 2022-2024 Hubert Figuière * * This library is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -285,7 +285,7 @@ impl Dir { if data[5] == 0 && data[7] == 0 { match data[6] { - 0x08 | 0x09 | 0x0a => + 0x08..=0x0a => // Leica Q Typ 116, SL (Type 601), Q3 (0x0a) return Dir::new_makernote( b"Exif.Leica5\0", |