Fixes for clippy bringing us down to 18 remaining issues.

This brings us a step closer to enforcing clippy on each build.
This commit is contained in:
Ewan Higgs 2022-10-24 21:34:13 +02:00
parent 004c09a8e2
commit 6b2fe94192
26 changed files with 117 additions and 131 deletions

View file

@ -34,7 +34,7 @@ where
type EItem = (&'a str, C::EItem);
fn bytes_encode((string, value): &'a Self::EItem) -> Option<Cow<[u8]>> {
let value_bytes = C::bytes_encode(&value)?;
let value_bytes = C::bytes_encode(value)?;
let mut bytes = Vec::with_capacity(2 + string.len() + value_bytes.len());
encode_prefix_string(string, &mut bytes).ok()?;

View file

@ -66,14 +66,14 @@ where
bytes.extend_from_slice(left.as_bytes());
bytes.extend_from_slice(right.as_bytes());
let value_bytes = C::bytes_encode(&value)?;
let value_bytes = C::bytes_encode(value)?;
bytes.extend_from_slice(&value_bytes[..]);
Some(Cow::Owned(bytes))
}
None => {
bytes.push(0);
let value_bytes = C::bytes_encode(&value)?;
let value_bytes = C::bytes_encode(value)?;
bytes.extend_from_slice(&value_bytes[..]);
Some(Cow::Owned(bytes))
}