diff options
Diffstat (limited to 'common/object/src/buffer.rs')
| -rw-r--r-- | common/object/src/buffer.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/common/object/src/buffer.rs b/common/object/src/buffer.rs index 4d3af34..0de5d70 100644 --- a/common/object/src/buffer.rs +++ b/common/object/src/buffer.rs @@ -65,7 +65,7 @@ pub fn vec_to_ob(v: Vec<u32>) -> Box<Object> { //? safe way to do this? unsafe { std::mem::transmute(v.into_boxed_slice()) } } -pub const fn slice_to_ob<'a>(v: &'a [u32]) -> &'a Object { +pub const fn slice_to_ob(v: &[u32]) -> &Object { //? safe way to do this? unsafe { std::mem::transmute(v) } } @@ -73,7 +73,7 @@ pub const fn slice_to_ob<'a>(v: &'a [u32]) -> &'a Object { #[inline] pub(super) fn pad_vec(temp: &mut Vec<u8>) -> u32 { let mut pad = 0; - while temp.len() % 4 != 0 { + while !temp.len().is_multiple_of(4) { pad += 1; temp.push(0); } @@ -96,7 +96,7 @@ pub fn slice_u8_to_u32<'a>(value: &'a [u8]) -> Cow<'a, [u32]> { trace!("encountered unalined slice"); Cow::Owned( value - .into_iter() + .iter() .copied() .array_chunks() .map(u32::from_ne_bytes) |