Skip to content

Commit eb2f8a5

Browse files
authored
chore: Fix nightly lints (#98)
1 parent b98e819 commit eb2f8a5

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/encoder.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fn encode_vlq_diff(out: &mut String, a: u32, b: u32) {
2424
encode_vlq(out, i64::from(a) - i64::from(b))
2525
}
2626

27-
fn encode_rmi(out: &mut Vec<u8>, data: &mut Vec<u8>) {
27+
fn encode_rmi(out: &mut Vec<u8>, data: &[u8]) {
2828
fn encode_byte(b: u8) -> u8 {
2929
match b {
3030
0..=25 => b + b'A',
@@ -36,7 +36,7 @@ fn encode_rmi(out: &mut Vec<u8>, data: &mut Vec<u8>) {
3636
}
3737
}
3838

39-
let bits = data.view_bits_mut::<Lsb0>();
39+
let bits = data.view_bits::<Lsb0>();
4040

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

5050
for byte in bits.chunks(6) {
5151
let byte = byte.load::<u8>();
@@ -81,7 +81,7 @@ fn serialize_range_mappings(sm: &SourceMap) -> Option<String> {
8181

8282
while token.get_dst_line() != prev_line {
8383
if had_rmi {
84-
encode_rmi(&mut buf, &mut rmi_data);
84+
encode_rmi(&mut buf, &rmi_data);
8585
rmi_data.clear();
8686
}
8787

@@ -96,7 +96,7 @@ fn serialize_range_mappings(sm: &SourceMap) -> Option<String> {
9696
}
9797

9898
if had_rmi {
99-
encode_rmi(&mut buf, &mut rmi_data);
99+
encode_rmi(&mut buf, &rmi_data);
100100
}
101101

102102
Some(String::from_utf8(buf).expect("invalid utf8"))
@@ -240,7 +240,7 @@ fn test_encode_rmi() {
240240
bits.set(i, true);
241241
}
242242

243-
encode_rmi(&mut out, &mut data);
243+
encode_rmi(&mut out, &data);
244244
String::from_utf8(out).unwrap()
245245
}
246246

src/types.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,21 +170,21 @@ impl<'a> Token<'a> {
170170
}
171171
}
172172

173-
impl<'a> PartialEq for Token<'a> {
173+
impl PartialEq for Token<'_> {
174174
fn eq(&self, other: &Token<'_>) -> bool {
175175
self.raw == other.raw
176176
}
177177
}
178178

179-
impl<'a> Eq for Token<'a> {}
179+
impl Eq for Token<'_> {}
180180

181-
impl<'a> PartialOrd for Token<'a> {
181+
impl PartialOrd for Token<'_> {
182182
fn partial_cmp(&self, other: &Token<'_>) -> Option<Ordering> {
183183
Some(self.cmp(other))
184184
}
185185
}
186186

187-
impl<'a> Ord for Token<'a> {
187+
impl Ord for Token<'_> {
188188
fn cmp(&self, other: &Token<'_>) -> Ordering {
189189
macro_rules! try_cmp {
190190
($a:expr, $b:expr) => {
@@ -312,7 +312,7 @@ pub struct TokenIter<'a> {
312312
next_idx: usize,
313313
}
314314

315-
impl<'a> TokenIter<'a> {
315+
impl TokenIter<'_> {
316316
pub fn seek(&mut self, line: u32, col: u32) -> bool {
317317
let token = self.i.lookup_token(line, col);
318318
match token {
@@ -387,13 +387,13 @@ impl<'a> Iterator for NameIter<'a> {
387387
}
388388
}
389389

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

396-
impl<'a> fmt::Display for Token<'a> {
396+
impl fmt::Display for Token<'_> {
397397
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
398398
write!(
399399
f,

0 commit comments

Comments
 (0)