Skip to content

Commit

Permalink
Fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Enet4 committed Jan 3, 2021
1 parent b993a3a commit ff2b299
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/greedy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ where
}

let len = usize::min(to_read.len(), buf.len());
&mut buf[..len].copy_from_slice(&self.buf[self.consumed..self.consumed + len]);
buf[..len].copy_from_slice(&self.buf[self.consumed..self.consumed + len]);
self.consume(len);
Ok(len)
}
Expand All @@ -201,7 +201,7 @@ where
// safe because it's within the buffer's limits
// and we won't be reading uninitialized memory
std::slice::from_raw_parts_mut(
self.buf.as_mut_ptr().offset(b as isize),
self.buf.as_mut_ptr().add(b),
self.buf.capacity() - b)
};

Expand Down

0 comments on commit ff2b299

Please sign in to comment.