From abf3cc617d3722ee89f4086101f708abcf4eaa23 Mon Sep 17 00:00:00 2001 From: "A. Molzer" <5550310+197g@users.noreply.github.com> Date: Thu, 5 Feb 2026 02:46:10 +0100 Subject: [PATCH] Bump MSRV to 1.88 --- .github/workflows/rust.yml | 8 ++++---- Cargo.toml | 2 +- src/decoder/image.rs | 2 +- src/encoder/mod.rs | 2 +- src/encoder/writer.rs | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index fe3ebab..3462807 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -9,14 +9,14 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - rust: ["1.85.0", stable, beta, nightly] + rust: ["1.88.0", stable, beta, nightly] steps: - uses: actions/checkout@v2 - uses: dtolnay/rust-toolchain@nightly - if: ${{ matrix.rust == '1.85.0' }} + if: ${{ matrix.rust == '1.88.0' }} - name: Generate Cargo.lock with minimal-version dependencies - if: ${{ matrix.rust == '1.85.0' }} + if: ${{ matrix.rust == '1.88.0' }} run: cargo -Zminimal-versions generate-lockfile - uses: dtolnay/rust-toolchain@v1 @@ -29,7 +29,7 @@ jobs: - name: build run: cargo build -v - name: test - if: ${{ matrix.rust != '1.85.0' }} + if: ${{ matrix.rust != '1.88.0' }} run: cargo test -v && cargo doc -v features: diff --git a/Cargo.toml b/Cargo.toml index f90327a..c1a7f0f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" resolver = "2" # note: when changed, also update test runner in `.github/workflows/rust.yml` -rust-version = "1.85.0" +rust-version = "1.88.0" license = "MIT" description = "TIFF decoding and encoding library in pure Rust" diff --git a/src/decoder/image.rs b/src/decoder/image.rs index 4af80e9..7972f19 100644 --- a/src/decoder/image.rs +++ b/src/decoder/image.rs @@ -1029,7 +1029,7 @@ impl Image { debug_assert!(bits_per_pixel >= photometric_bit_end); - if bits_per_pixel % 8 != 0 || photometric_bit_end % 8 != 0 { + if !bits_per_pixel.is_multiple_of(8) || !photometric_bit_end.is_multiple_of(8) { return Err(TiffError::UnsupportedError( TiffUnsupportedError::InterpretationWithBits( self.photometric_interpretation, diff --git a/src/encoder/mod.rs b/src/encoder/mod.rs index 8f1cb20..b043a4d 100644 --- a/src/encoder/mod.rs +++ b/src/encoder/mod.rs @@ -403,7 +403,7 @@ impl<'a, W: 'a + Write + Seek, K: TiffKind> DirectoryEncoder<'a, W, K> { /// Returns an [`Entry`]. If the value is short enough it will *not* be written in the file but /// stored in the entry's offset field. pub fn write_entry_bytes(&mut self, ty: Type, data: &[u8]) -> TiffResult { - if data.len() % usize::from(ty.byte_len()) != 0 { + if !data.len().is_multiple_of(usize::from(ty.byte_len())) { return Err(TiffError::UsageError(UsageError::MismatchedEntryLength { ty, found: data.len(), diff --git a/src/encoder/writer.rs b/src/encoder/writer.rs index 6b7eb16..468ddf5 100644 --- a/src/encoder/writer.rs +++ b/src/encoder/writer.rs @@ -172,7 +172,7 @@ impl TiffWriter { } pub fn pad_word_boundary(&mut self) -> Result<(), io::Error> { - if self.offset % 4 != 0 { + if !self.offset.is_multiple_of(4) { let padding = [0, 0, 0]; let padd_len = 4 - (self.offset % 4); self.writer.write_all(&padding[..padd_len as usize])?;