mirror of
https://codeberg.org/icewind/bitbuffer.git
synced 2026-06-04 00:54:07 +02:00
clippy fixes
This commit is contained in:
parent
b0abd91399
commit
07dc4686f3
2 changed files with 6 additions and 6 deletions
|
|
@ -396,16 +396,16 @@ impl SplitFitUsize for usize {
|
||||||
(if E::is_le() {
|
(if E::is_le() {
|
||||||
[
|
[
|
||||||
(
|
(
|
||||||
(self & (Self::MAX >> (usize::BITS - 8))) as usize,
|
self & (Self::MAX >> (usize::BITS - 8)),
|
||||||
usize::BITS as u8 - 8,
|
usize::BITS as u8 - 8,
|
||||||
),
|
),
|
||||||
((self >> (usize::BITS - 8)) as usize, 8),
|
(self >> (usize::BITS - 8), 8),
|
||||||
]
|
]
|
||||||
} else {
|
} 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,
|
usize::BITS as u8 - 8,
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ pub(crate) enum Data<'a> {
|
||||||
impl<'a> Data<'a> {
|
impl<'a> Data<'a> {
|
||||||
pub fn as_slice(&self) -> &[u8] {
|
pub fn as_slice(&self) -> &[u8] {
|
||||||
match self {
|
match self {
|
||||||
Data::Borrowed(bytes) => *bytes,
|
Data::Borrowed(bytes) => bytes,
|
||||||
Data::Owned(bytes) => bytes.borrow(),
|
Data::Owned(bytes) => bytes.borrow(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -71,7 +71,7 @@ impl<'a> Index<usize> for Data<'a> {
|
||||||
impl<'a> Clone for Data<'a> {
|
impl<'a> Clone for Data<'a> {
|
||||||
fn clone(&self) -> Self {
|
fn clone(&self) -> Self {
|
||||||
match self {
|
match self {
|
||||||
Data::Borrowed(bytes) => Data::Borrowed(*bytes),
|
Data::Borrowed(bytes) => Data::Borrowed(bytes),
|
||||||
Data::Owned(bytes) => Data::Owned(Rc::clone(bytes)),
|
Data::Owned(bytes) => Data::Owned(Rc::clone(bytes)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue