1
0
Fork 0
mirror of https://codeberg.org/icewind/bitbuffer.git synced 2026-06-03 08:34:07 +02:00

clippy fixes

This commit is contained in:
Robin Appelman 2023-07-02 15:55:51 +02:00
commit 07dc4686f3
2 changed files with 6 additions and 6 deletions

View file

@ -396,16 +396,16 @@ impl SplitFitUsize for usize {
(if E::is_le() {
[
(
(self & (Self::MAX >> (usize::BITS - 8))) as usize,
self & (Self::MAX >> (usize::BITS - 8)),
usize::BITS as u8 - 8,
),
((self >> (usize::BITS - 8)) as usize, 8),
(self >> (usize::BITS - 8), 8),
]
} else {
[
((self >> (usize::BITS - 8)) as usize, 8),
(self >> (usize::BITS - 8), 8),
(
(self & (Self::MAX >> (usize::BITS - 8))) as usize,
self & (Self::MAX >> (usize::BITS - 8)),
usize::BITS as u8 - 8,
),
]

View file

@ -26,7 +26,7 @@ pub(crate) enum Data<'a> {
impl<'a> Data<'a> {
pub fn as_slice(&self) -> &[u8] {
match self {
Data::Borrowed(bytes) => *bytes,
Data::Borrowed(bytes) => bytes,
Data::Owned(bytes) => bytes.borrow(),
}
}
@ -71,7 +71,7 @@ impl<'a> Index<usize> for Data<'a> {
impl<'a> Clone for Data<'a> {
fn clone(&self) -> Self {
match self {
Data::Borrowed(bytes) => Data::Borrowed(*bytes),
Data::Borrowed(bytes) => Data::Borrowed(bytes),
Data::Owned(bytes) => Data::Owned(Rc::clone(bytes)),
}
}