From c8f37a031f549a1f884de3a747eb637ea9130137 Mon Sep 17 00:00:00 2001 From: sharkAndshar Date: Fri, 29 Nov 2024 16:25:50 +0800 Subject: [PATCH] wip --- martin/src/cog/mod.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/martin/src/cog/mod.rs b/martin/src/cog/mod.rs index 0aeabbbe9..8ebd5fc7a 100644 --- a/martin/src/cog/mod.rs +++ b/martin/src/cog/mod.rs @@ -8,8 +8,8 @@ use regex::Regex; use std::collections::HashMap; use std::fs::File; use std::path::Path; +use std::vec; use std::{fmt::Debug, path::PathBuf}; -use std::{u8, vec}; use std::io::BufWriter; use tiff::decoder::{Decoder, DecodingResult}; @@ -315,6 +315,8 @@ impl Source for CogSource { } } +#[allow(clippy::cast_sign_loss)] +#[allow(clippy::cast_possible_truncation)] fn scale_to_u8( vec: &[T], samples_count: u8, @@ -513,7 +515,7 @@ fn get_meta(path: &PathBuf) -> Result { fn get_minmax_of_samples( decoder: &mut Decoder, - path: &PathBuf, + path: &Path, ) -> Result<(Vec, Vec), CogError> { let gdal_metadata_tag = Tag::Unknown(42112); let metadata = decoder.get_tag_ascii_string(gdal_metadata_tag); @@ -529,7 +531,7 @@ fn get_minmax_of_samples( let value: f64 = cap[2].parse::().map_err(|_| { CogError::ParseSTATISTICSValueFailed( "STATISTICS_MINIMUM".to_string(), - path.clone(), + path.to_path_buf(), ) })?; min_values.push(value); @@ -545,7 +547,7 @@ fn get_minmax_of_samples( let value: f64 = cap[2].parse().map_err(|_| { CogError::ParseSTATISTICSValueFailed( "sample of STATISTICS_MINIMUM".to_string(), - path.clone(), + path.to_path_buf(), ) })?; max_values.push(value);