mirror of
https://github.com/cccb/servicepoint.git
synced 2025-01-18 10:00:14 +01:00
manual clippy fixes
This commit is contained in:
parent
b0de3a4fb5
commit
237ca6d6a2
|
@ -76,6 +76,11 @@ impl BitVec {
|
|||
self.data.len() * 8
|
||||
}
|
||||
|
||||
/// returns true if length is 0.
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.data.is_empty()
|
||||
}
|
||||
|
||||
/// Get the underlying bits in their raw packed bytes form
|
||||
pub fn mut_data_ref(&mut self) -> &mut [u8] {
|
||||
self.data.as_mut_slice()
|
||||
|
@ -174,6 +179,12 @@ pub mod c_api {
|
|||
(*this).len()
|
||||
}
|
||||
|
||||
/// Returns true if length is 0.
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn sp2_bit_vec_is_empty(this: *const BitVec) -> bool {
|
||||
(*this).is_empty()
|
||||
}
|
||||
|
||||
/// Gets an unsafe reference to the data of the `BitVec` instance.
|
||||
///
|
||||
/// ## Safety
|
||||
|
|
|
@ -93,7 +93,7 @@ pub(crate) fn into_compressed(
|
|||
let mut encoder = Lz4EncoderBuilder::new()
|
||||
.build(vec![])
|
||||
.expect("could not create encoder");
|
||||
encoder.write(&payload).expect("could not write payload");
|
||||
encoder.write_all(&payload).expect("could not write payload");
|
||||
let (payload, _) = encoder.finish();
|
||||
payload
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ pub(crate) fn into_compressed(
|
|||
ZstdEncoder::new(vec![], zstd::DEFAULT_COMPRESSION_LEVEL)
|
||||
.expect("could not create encoder");
|
||||
encoder
|
||||
.write(&payload)
|
||||
.write_all(&payload)
|
||||
.expect("could not compress payload");
|
||||
encoder.finish().expect("could not finish encoding")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue