Skip to content

Commit 6de6b2d

Browse files
authored
fixup clippy 1.85 lints (#1664)
1 parent 63c3ba9 commit 6de6b2d

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

.github/workflows/workspace.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- uses: actions/checkout@v4
2222
- uses: dtolnay/rust-toolchain@master
2323
with:
24-
toolchain: 1.84.0
24+
toolchain: 1.85.0
2525
components: clippy
2626
- run: cargo clippy --all --all-features --tests
2727

const-oid/src/arcs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl<'a> Arcs<'a> {
9090
return Err(Error::ArcTooBig);
9191
}
9292

93-
result = result << 7 | (byte & 0b1111111) as Arc;
93+
result = (result << 7) | (byte & 0b1111111) as Arc;
9494

9595
if byte & 0b10000000 == 0 {
9696
self.cursor = Some(checked_add!(offset, arc_bytes));

der/src/asn1/real.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ pub(crate) fn is_nth_bit_one<const N: usize>(bytes: &[u8]) -> bool {
215215
pub(crate) fn mnth_bits_to_u8<const M: usize, const N: usize>(bytes: &[u8]) -> u8 {
216216
let bit_m = is_nth_bit_one::<M>(bytes);
217217
let bit_n = is_nth_bit_one::<N>(bytes);
218-
(bit_m as u8) << 1 | bit_n as u8
218+
((bit_m as u8) << 1) | bit_n as u8
219219
}
220220

221221
/// Decode an f64 as its sign, exponent, and mantissa in u64 and in that order, using bit shifts and masks.
@@ -224,7 +224,7 @@ pub(crate) fn mnth_bits_to_u8<const M: usize, const N: usize>(bytes: &[u8]) -> u
224224
pub(crate) fn decode_f64(f: f64) -> (u64, u64, u64) {
225225
let bits = f.to_bits();
226226
let sign = bits >> 63;
227-
let exponent = bits >> 52 & 0x7ff;
227+
let exponent = (bits >> 52) & 0x7ff;
228228
let exponent_bytes_no_bias = (exponent as i16 - 1023).to_be_bytes();
229229
let exponent_no_bias = u64::from_be_bytes([
230230
0x0,
@@ -245,7 +245,7 @@ pub(crate) fn encode_f64(sign: u64, exponent: u64, mantissa: u64) -> f64 {
245245
// Add the bias to the exponent
246246
let exponent_with_bias =
247247
(i16::from_be_bytes([exponent.to_be_bytes()[6], exponent.to_be_bytes()[7]]) + 1023) as u64;
248-
let bits = sign << 63 | exponent_with_bias << 52 | (mantissa - 1);
248+
let bits = (sign << 63) | (exponent_with_bias << 52) | (mantissa - 1);
249249
f64::from_bits(bits)
250250
}
251251

0 commit comments

Comments
 (0)