Fix a lot of Clippy warnings (#1808)

* fix a lot of clippy warnings

* fix more clippy warnings

* fix yet more clippy warnings

* bump msrv to 1.70.0 to silence warnings

* fix a lot of clippy warnings

* fix more clippy warnings

* fix yet more clippy warnings

* fix a few more warnings

* fix a clippy warning

* remove a commented out line

* silense too many arguments error

* fix more clippy warnings

* prefix underscore to unused vars/functions to fix warnings

* use filter instead of map

* move raw-rs-tests feature flat to module level to fix unused imports warnings

* fix a couple of unused result warnings

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Raminder Singh
2024-07-09 05:02:52 -07:00
committed by GitHub
co-authored by Keavon Chambers
parent f7ada701e5
commit 62f73df048
49 changed files with 264 additions and 260 deletions
+3 -6
View File
@@ -1,3 +1,4 @@
#![cfg(feature = "raw-rs-tests")]
use std::collections::HashMap;
use std::fmt::Write;
use std::fs::{read_dir, File};
@@ -13,7 +14,6 @@ const BASE_URL: &str = "https://static.graphite.rs/test-data/libraries/raw-rs/";
const BASE_PATH: &str = "./tests/images";
#[test]
#[cfg(feature = "raw-rs-tests")]
fn test_images_match_with_libraw() {
download_images();
@@ -30,7 +30,7 @@ fn test_images_match_with_libraw() {
print!("{} => ", path.display());
let raw_image = match test_raw_data(&content) {
let _raw_image = match test_raw_data(&content) {
Err(err_msg) => {
failed_tests += 1;
return println!("{}", err_msg);
@@ -54,7 +54,6 @@ fn test_images_match_with_libraw() {
}
}
#[cfg(feature = "raw-rs-tests")]
fn download_images() {
let mut path = Path::new(BASE_PATH).to_owned();
let mut downloads: Vec<Download> = Vec::new();
@@ -75,7 +74,6 @@ fn download_images() {
}
}
#[cfg(feature = "raw-rs-tests")]
fn test_raw_data(content: &[u8]) -> Result<RawImage, String> {
let processor = libraw::Processor::new();
let libraw_raw_image = processor.decode(content).unwrap();
@@ -149,8 +147,7 @@ fn test_raw_data(content: &[u8]) -> Result<RawImage, String> {
Ok(raw_image)
}
#[cfg(feature = "raw-rs-tests")]
fn test_final_image(content: &[u8], raw_image: RawImage) -> Result<(), String> {
fn _test_final_image(content: &[u8], raw_image: RawImage) -> Result<(), String> {
let processor = libraw::Processor::new();
let libraw_image = processor.process_8bit(content).unwrap();