1
Fork 0

Rollup merge of #123188 - klensy:clippy-me2, r=Nilstrieb

compiler: fix few unused_peekable and needless_pass_by_ref_mut clippy lints

This fixes few instances of `unused_peekable` and `needless_pass_by_ref_mut`. While i expected to fix more warnings, `needless_pass_by_ref_mut` produced too much for one PR, so i stopped here.

Better reviewed commit by commit, as fixes splitted by chunks.
This commit is contained in:
Matthias Krüger 2024-03-29 15:17:11 +01:00 committed by GitHub
commit 8d820c0c47
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
40 changed files with 111 additions and 120 deletions

View file

@ -13,7 +13,7 @@ use ut::UnifyKey;
use std::ops::Range;
fn vars_since_snapshot<'tcx, T>(
table: &mut UnificationTable<'_, 'tcx, T>,
table: &UnificationTable<'_, 'tcx, T>,
snapshot_var_len: usize,
) -> Range<T>
where
@ -124,11 +124,11 @@ impl<'tcx> InferCtxt<'tcx> {
let type_vars =
inner.type_variables().vars_since_snapshot(variable_lengths.type_var_len);
let int_vars = vars_since_snapshot(
&mut inner.int_unification_table(),
&inner.int_unification_table(),
variable_lengths.int_var_len,
);
let float_vars = vars_since_snapshot(
&mut inner.float_unification_table(),
&inner.float_unification_table(),
variable_lengths.float_var_len,
);
let region_vars = inner