Skip to content

Commit

Permalink
Merge pull request #203 from nickbabcock/lifetimes
Browse files Browse the repository at this point in the history
Remove unnecessary lifetimes
  • Loading branch information
nickbabcock authored Jan 20, 2025
2 parents 7b6ec94 + dabbf99 commit 0c3720f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/bits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub(crate) trait RlBits {
F: FnMut(&mut Self) -> Option<T>;
}

impl<'a> RlBits for LittleEndianReader<'a> {
impl RlBits for LittleEndianReader<'_> {
#[inline]
fn peek_and_consume(&mut self, bits: u32) -> u64 {
let res = self.peek(bits);
Expand Down
11 changes: 7 additions & 4 deletions src/core_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@ impl<'a> CoreParser<'a> {
}

pub fn take_bytes<const N: usize>(&mut self) -> Result<[u8; N], ParseError> {
let (result, tail) = self
.data
.split_first_chunk::<N>()
.ok_or_else(|| ParseError::InsufficientData(N as i32, self.data.len() as i32))?;
let (result, tail) =
self.data
.split_first_chunk::<N>()
.ok_or(ParseError::InsufficientData(
N as i32,
self.data.len() as i32,
))?;
self.col += N as i32;
self.data = tail;
Ok(*result)
Expand Down
2 changes: 1 addition & 1 deletion src/network/frame_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ enum DecodedFrame {
Frame(Frame),
}

impl<'a, 'b> FrameDecoder<'a, 'b> {
impl FrameDecoder<'_, '_> {
fn parse_new_actor(
&self,
bits: &mut LittleEndianReader<'_>,
Expand Down
2 changes: 1 addition & 1 deletion src/network/object_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub(crate) struct AncestorIterator<'a, 'b> {
index: &'a ObjectIndex<'b>,
}

impl<'a, 'b> Iterator for AncestorIterator<'a, 'b> {
impl Iterator for AncestorIterator<'_, '_> {
type Item = ObjectId;

fn next(&mut self) -> Option<Self::Item> {
Expand Down

0 comments on commit 0c3720f

Please sign in to comment.