Skip to content

Commit

Permalink
Fix lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
myrrlyn committed Jul 5, 2022
1 parent 591199e commit 86cc73b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
# attributes set directly in the source code. #
########################################################################

msrv = "1.54.0"
msrv = "1.56.0"
single-char-binding-names-threshold = 8
too-many-arguments-threshold = 8
6 changes: 4 additions & 2 deletions src/ptr/single.rs
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ where
/// See [`ptr::read`](crate::ptr::read).
#[inline]
pub unsafe fn read(self) -> bool {
(&*self.ptr.to_const()).load_value().get_bit::<O>(self.bit)
(*self.ptr.to_const()).load_value().get_bit::<O>(self.bit)
}

/// Reads the bit from `*self` using a volatile load.
Expand Down Expand Up @@ -1117,6 +1117,7 @@ where
/// [`ptr::write_volatile`]: crate::ptr::write_volatile
/// [`voladdr`]: https://docs.rs/voladdr/latest/voladdr
#[inline]
#[allow(clippy::needless_borrow)] // Clippy is wrong.
pub unsafe fn write_volatile(self, value: bool) {
let ptr = self.ptr.to_mut();
let mut tmp = ptr.read_volatile();
Expand All @@ -1140,6 +1141,7 @@ where
///
/// [`ptr::write_unaligned`]: crate::ptr::write_unaligned
#[inline]
#[allow(clippy::needless_borrow)] // Clippy is wrong.
#[deprecated = "`BitPtr` does not have unaligned addresses"]
pub unsafe fn write_unaligned(self, value: bool) {
let ptr = self.ptr.to_mut();
Expand Down Expand Up @@ -1198,7 +1200,7 @@ where
/// This is used to allow `BitPtr<Const, _, AliasSafe<T>>` pointers, which
/// are not `Mut` but may still modify memory, to do so.
pub(crate) unsafe fn frozen_write_bit(self, value: bool) -> bool {
(&*self.ptr.cast::<T::Access>().to_const())
(*self.ptr.cast::<T::Access>().to_const())
.write_bit::<O>(self.bit, value)
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,7 @@ where
return self.fill(false);
}
assert!(
by < len,
by <= len,
"shift must be less than the length of the bit-slice: {} >= {}",
by,
len,
Expand Down Expand Up @@ -1539,7 +1539,7 @@ where
return self.fill(false);
}
assert!(
by < len,
by <= len,
"shift must be less than the length of the bit-slice: {} >= {}",
by,
len,
Expand Down
4 changes: 2 additions & 2 deletions src/slice/specialization/lsb0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ where T: BitStore
as *mut BitSlice<T::Access, Lsb0>
});
for (from, to) in from.zip(to).bidi(rev) {
let value = (&*from).load_le::<usize>();
(&mut *to).store_le::<usize>(value);
let value = (*from).load_le::<usize>();
(*to).store_le::<usize>(value);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/slice/specialization/msb0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ where T: BitStore
as *mut BitSlice<T::Access, Msb0>
});
for (from, to) in from.zip(to).bidi(rev) {
let value = (&*from).load_be::<usize>();
(&mut *to).store_be::<usize>(value);
let value = (*from).load_be::<usize>();
(*to).store_be::<usize>(value);
}
}

Expand Down

0 comments on commit 86cc73b

Please sign in to comment.