Skip to content

Commit

Permalink
chore: Fix nightly lints
Browse files Browse the repository at this point in the history
  • Loading branch information
loewenheim committed Nov 13, 2024
1 parent 9130f31 commit e6134ea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn encode_vlq_diff(out: &mut String, a: u32, b: u32) {
encode_vlq(out, i64::from(a) - i64::from(b))
}

fn encode_rmi(out: &mut Vec<u8>, data: &mut Vec<u8>) {
fn encode_rmi(out: &mut Vec<u8>, data: &[u8]) {
fn encode_byte(b: u8) -> u8 {
match b {
0..=25 => b + b'A',
Expand All @@ -36,7 +36,7 @@ fn encode_rmi(out: &mut Vec<u8>, data: &mut Vec<u8>) {
}
}

let bits = data.view_bits_mut::<Lsb0>();
let bits = data.view_bits::<Lsb0>();

// trim zero at the end
let mut last = 0;
Expand All @@ -45,7 +45,7 @@ fn encode_rmi(out: &mut Vec<u8>, data: &mut Vec<u8>) {
last = idx;
}
}
let bits = &mut bits[..last + 1];
let bits = &bits[..last + 1];

for byte in bits.chunks(6) {
let byte = byte.load::<u8>();
Expand Down
14 changes: 7 additions & 7 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,21 +170,21 @@ impl<'a> Token<'a> {
}
}

impl<'a> PartialEq for Token<'a> {
impl PartialEq for Token<'_> {
fn eq(&self, other: &Token<'_>) -> bool {
self.raw == other.raw
}
}

impl<'a> Eq for Token<'a> {}
impl Eq for Token<'_> {}

impl<'a> PartialOrd for Token<'a> {
impl PartialOrd for Token<'_> {
fn partial_cmp(&self, other: &Token<'_>) -> Option<Ordering> {
Some(self.cmp(other))
}
}

impl<'a> Ord for Token<'a> {
impl Ord for Token<'_> {
fn cmp(&self, other: &Token<'_>) -> Ordering {
macro_rules! try_cmp {
($a:expr, $b:expr) => {
Expand Down Expand Up @@ -312,7 +312,7 @@ pub struct TokenIter<'a> {
next_idx: usize,
}

impl<'a> TokenIter<'a> {
impl TokenIter<'_> {
pub fn seek(&mut self, line: u32, col: u32) -> bool {
let token = self.i.lookup_token(line, col);
match token {
Expand Down Expand Up @@ -387,13 +387,13 @@ impl<'a> Iterator for NameIter<'a> {
}
}

impl<'a> fmt::Debug for Token<'a> {
impl fmt::Debug for Token<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "<Token {self:#}>")
}
}

impl<'a> fmt::Display for Token<'a> {
impl fmt::Display for Token<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
f,
Expand Down

0 comments on commit e6134ea

Please sign in to comment.