Skip to content

Commit

Permalink
fix more lints
Browse files Browse the repository at this point in the history
  • Loading branch information
polazarus committed Feb 9, 2025
1 parent daf572f commit a2994b0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/bytes/borsh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ use crate::Backend;
#[cfg(test)]
mod tests;

impl<'borrow, B: Backend> BorshDeserialize for HipByt<'borrow, B> {
impl<B: Backend> BorshDeserialize for HipByt<'_, B> {
fn deserialize_reader<R: io::Read>(reader: &mut R) -> io::Result<Self> {
let len = u32::deserialize_reader(reader)? as usize;
if len == 0 {
Ok(Self::new())
} else {
let mut result = Self::with_capacity(len);
let slice = result.spare_capacity_mut();
for i in 0..len {
slice[i].write(u8::deserialize_reader(reader)?);
for byte in slice.iter_mut().take(len) {
byte.write(u8::deserialize_reader(reader)?);
}
unsafe {
result.set_len(len);
Expand All @@ -28,7 +28,7 @@ impl<'borrow, B: Backend> BorshDeserialize for HipByt<'borrow, B> {
}
}

impl<'borrow, B: Backend> BorshSerialize for HipByt<'borrow, B> {
impl<B: Backend> BorshSerialize for HipByt<'_, B> {
fn serialize<W: io::Write>(&self, writer: &mut W) -> io::Result<()> {
self.as_slice().serialize(writer)
}
Expand Down
6 changes: 3 additions & 3 deletions src/string/borsh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ use crate::Backend;
#[cfg(test)]
mod tests;

impl<'borrow, B: Backend> BorshDeserialize for HipStr<'borrow, B> {
impl<B: Backend> BorshDeserialize for HipStr<'_, B> {
fn deserialize_reader<R: io::Read>(reader: &mut R) -> io::Result<Self> {
let bytes: HipByt<'borrow, B> = HipByt::deserialize_reader(reader)?;
let bytes: HipByt<B> = HipByt::deserialize_reader(reader)?;
Self::try_from(bytes).map_err(|err| {
let msg = err.to_string();
Error::new(ErrorKind::InvalidData, msg)
})
}
}

impl<'borrow, B: Backend> BorshSerialize for HipStr<'borrow, B> {
impl<B: Backend> BorshSerialize for HipStr<'_, B> {
fn serialize<W: io::Write>(&self, writer: &mut W) -> io::Result<()> {
self.as_bytes().serialize(writer)
}
Expand Down
2 changes: 1 addition & 1 deletion src/string/bstr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ symmetric_ord! {
[B] [where B: Backend] (&BString, HipStr<'_, B>) = bstr_cmp;
}

impl<'a, B> TryFrom<BString> for HipStr<'a, B>
impl<B> TryFrom<BString> for HipStr<'_, B>
where
B: Backend,
{
Expand Down

0 comments on commit a2994b0

Please sign in to comment.