diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index d0a5d10064..01dfd230d3 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - rust: ["1.61.0", stable, beta, nightly] + rust: ["1.64.0", stable, beta, nightly] features: [gif, jpeg, png, tiff, ico, pnm, tga, webp, bmp, hdr, dxt, dds, farbfeld, openexr, jpeg_rayon, webp-encoder, ''] steps: - uses: actions/checkout@v2 diff --git a/Cargo.toml b/Cargo.toml index 8fe4622cae..dd4e9d0a2e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ edition = "2018" resolver = "2" # note: when changed, also update test runner in `.github/workflows/rust.yml` -rust-version = "1.61.0" +rust-version = "1.64.0" license = "MIT" description = "Imaging library written in Rust. Provides basic filters and decoders for the most common image formats." diff --git a/src/codecs/jpeg/encoder.rs b/src/codecs/jpeg/encoder.rs index 82c582fb57..9dc5bb2c09 100644 --- a/src/codecs/jpeg/encoder.rs +++ b/src/codecs/jpeg/encoder.rs @@ -763,7 +763,7 @@ fn build_quantization_segment(m: &mut Vec, precision: u8, identifier: u8, qt fn encode_coefficient(coefficient: i32) -> (u8, u16) { // since this is inlined, in the main AC case the compiler figures out that coefficient cannot be zero, so BSR on x86 doesn't need a branch if let Some(nz) = NonZeroI32::new(coefficient) { - let leading_zeros = nz.abs().leading_zeros() as u8; + let leading_zeros = nz.unsigned_abs().leading_zeros() as u8; // first shift right signed by 31 to make everything 1 if negative, // then shift right unsigned to make the leading bits 0