Skip to content

Commit 6327bc3

Browse files
committed
fmt + clippy fixes
1 parent 85228c1 commit 6327bc3

File tree

7 files changed

+11
-12
lines changed

7 files changed

+11
-12
lines changed

libraries/rawkit/src/decoder/arw1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::tiff::Ifd;
22
use crate::tiff::file::TiffRead;
33
use crate::tiff::tags::SonyDataOffset;
4-
use crate::{RawImage, SubtractBlack, OrientationValue};
4+
use crate::{OrientationValue, RawImage, SubtractBlack};
55
use bitstream_io::{BE, BitRead, BitReader, Endianness};
66
use std::io::{Read, Seek};
77

libraries/rawkit/src/decoder/arw2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::tiff::file::{Endian, TiffRead};
22
use crate::tiff::tags::{BitsPerSample, CfaPattern, CfaPatternDim, Compression, ImageLength, ImageWidth, SonyToneCurve, StripByteCounts, StripOffsets, Tag, WhiteBalanceRggbLevels};
33
use crate::tiff::values::{CompressionValue, CurveLookupTable};
44
use crate::tiff::{Ifd, TiffError};
5-
use crate::{RawImage, SubtractBlack, OrientationValue};
5+
use crate::{OrientationValue, RawImage, SubtractBlack};
66
use rawkit_proc_macros::Tag;
77
use std::io::{Read, Seek};
88

libraries/rawkit/src/decoder/uncompressed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::tiff::file::TiffRead;
22
use crate::tiff::tags::{BitsPerSample, BlackLevel, CfaPattern, CfaPatternDim, Compression, ImageLength, ImageWidth, RowsPerStrip, StripByteCounts, StripOffsets, Tag, WhiteBalanceRggbLevels};
33
use crate::tiff::values::CompressionValue;
44
use crate::tiff::{Ifd, TiffError};
5-
use crate::{RawImage, SubtractBlack, OrientationValue};
5+
use crate::{OrientationValue, RawImage, SubtractBlack};
66
use rawkit_proc_macros::Tag;
77
use std::io::{Read, Seek};
88

libraries/rawkit/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,13 @@ impl RawImage {
172172
// Check the first two bytes to determine the format of the thumbnail.
173173
// JPEG format starts with 0xFF, 0xD8.
174174
if thumbnail_data[0..2] == [0xFF, 0xD8] {
175-
return Ok(ThumbnailImage {
175+
Ok(ThumbnailImage {
176176
data: thumbnail_data,
177177
format: ThumbnailFormat::Jpeg,
178-
});
178+
})
179179
} else {
180180
Err(DecoderError::UnsupportedThumbnailFormat)
181181
}
182-
183182
}
184183

185184
/// Converts the [`RawImage`] to an [`Image`] with 8 bit resolution for each channel.

libraries/rawkit/src/postprocessing/transform.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::{Image, Pixel, OrientationValue};
1+
use crate::{Image, OrientationValue, Pixel};
22

33
impl Image<u16> {
44
pub fn orientation_iter(&self) -> (usize, usize, impl Iterator<Item = Pixel> + use<'_>) {

libraries/rawkit/src/tiff/types.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use super::file::TiffRead;
2-
use super::values::{CompressionValue, CurveLookupTable, Rational, OrientationValue};
2+
use super::values::{CompressionValue, CurveLookupTable, OrientationValue, Rational};
33
use super::{Ifd, IfdTagType, TiffError};
44
use std::io::{Read, Seek};
55

@@ -380,14 +380,14 @@ impl TagType for TypeOrientation {
380380
type Output = OrientationValue;
381381

382382
fn read<R: Read + Seek>(file: &mut TiffRead<R>) -> Result<Self::Output, TiffError> {
383-
Ok(OrientationValue::try_from(TypeShort::read(file)?).map_err(|_| TiffError::InvalidValue)?)
383+
OrientationValue::try_from(TypeShort::read(file)?).map_err(|_| TiffError::InvalidValue)
384384
}
385385
}
386386

387387
impl TagType for TypeCompression {
388388
type Output = CompressionValue;
389389

390390
fn read<R: Read + Seek>(file: &mut TiffRead<R>) -> Result<Self::Output, TiffError> {
391-
Ok(CompressionValue::try_from(TypeShort::read(file)?).map_err(|_| TiffError::InvalidValue)?)
391+
CompressionValue::try_from(TypeShort::read(file)?).map_err(|_| TiffError::InvalidValue)
392392
}
393-
}
393+
}

libraries/rawkit/src/tiff/values.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,4 @@ pub enum CompressionValue {
129129
JPEG_XL = 52546,
130130
Kodak_DCR_Compressed = 65000,
131131
Pentax_PEF_Compressed = 65535,
132-
}
132+
}

0 commit comments

Comments
 (0)