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
+1 -1
View File
@@ -106,7 +106,7 @@ impl Ifd {
})
}
fn next_ifd<R: Read + Seek>(&self, file: &mut TiffRead<R>) -> Result<Self, TiffError> {
fn _next_ifd<R: Read + Seek>(&self, file: &mut TiffRead<R>) -> Result<Self, TiffError> {
Ifd::new_from_offset(file, self.next_ifd_offset.unwrap_or(0))
}
+4 -4
View File
@@ -270,7 +270,7 @@ impl PrimitiveType for TypeIfd {
fn read_primitive<R: Read + Seek>(the_type: IfdTagType, file: &mut TiffRead<R>) -> Result<Self::Output, TiffError> {
let offset = TypeLong::read_primitive(the_type, file)?;
Ok(Ifd::new_from_offset(file, offset)?)
Ifd::new_from_offset(file, offset)
}
}
@@ -284,7 +284,7 @@ impl<T: PrimitiveType> TagType for T {
type Output = T::Output;
fn read<R: Read + Seek>(file: &mut TiffRead<R>) -> Result<Self::Output, TiffError> {
let the_type = IfdTagType::try_from(file.read_u16()?).map_err(|_| TiffError::InvalidType)?;
let the_type = IfdTagType::from(file.read_u16()?);
let count = file.read_u32()?;
if count != 1 {
@@ -313,7 +313,7 @@ impl<T: PrimitiveType> TagType for Array<T> {
type Output = Vec<T::Output>;
fn read<R: Read + Seek>(file: &mut TiffRead<R>) -> Result<Self::Output, TiffError> {
let the_type = IfdTagType::try_from(file.read_u16()?).map_err(|_| TiffError::InvalidType)?;
let the_type = IfdTagType::from(file.read_u16()?);
let count = file.read_u32()?;
let size = T::get_size(the_type).ok_or(TiffError::InvalidType)?;
@@ -334,7 +334,7 @@ impl<T: PrimitiveType, const N: usize> TagType for ConstArray<T, N> {
type Output = [T::Output; N];
fn read<R: Read + Seek>(file: &mut TiffRead<R>) -> Result<Self::Output, TiffError> {
let the_type = IfdTagType::try_from(file.read_u16()?).map_err(|_| TiffError::InvalidType)?;
let the_type = IfdTagType::from(file.read_u16()?);
let count = file.read_u32()?;
if count != N.try_into()? {