Skip to content

Commit d860d45

Browse files
committed
dogfood
1 parent 57ea24d commit d860d45

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

clippy_dev/src/update_lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ fn remove_lint_declaration(name: &str, path: &Path, lints: &mut Vec<Lint>) -> io
450450

451451
// Remove the module declaration (mod xyz;)
452452
let mod_decl = format!("\nmod {name};");
453-
content = content.replacen(&mod_decl, "", 1);
453+
let mut content = content.replacen(&mod_decl, "", 1);
454454

455455
remove_impl_lint_pass(&lint.name.to_uppercase(), &mut content);
456456
fs::write(path, content).unwrap_or_else(|_| panic!("failed to write to `{}`", path.to_string_lossy()));

clippy_lints/src/dereference.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -801,11 +801,11 @@ impl TyCoercionStability {
801801
}
802802

803803
fn for_mir_ty<'tcx>(tcx: TyCtxt<'tcx>, param_env: ParamEnv<'tcx>, ty: Ty<'tcx>, for_return: bool) -> Self {
804-
let ty::Ref(_, mut ty, _) = *ty.kind() else {
804+
let ty::Ref(_, ty, _) = *ty.kind() else {
805805
return Self::None;
806806
};
807807

808-
ty = tcx.try_normalize_erasing_regions(param_env, ty).unwrap_or(ty);
808+
let mut ty = tcx.try_normalize_erasing_regions(param_env, ty).unwrap_or(ty);
809809
loop {
810810
break match *ty.kind() {
811811
ty::Ref(_, ref_ty, _) => {

clippy_lints/src/operators/arithmetic_side_effects.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,10 @@ impl ArithmeticSideEffects {
178178
) {
179179
return;
180180
};
181-
let (mut actual_lhs, lhs_ref_counter) = peel_hir_expr_refs(lhs);
182-
let (mut actual_rhs, rhs_ref_counter) = peel_hir_expr_refs(rhs);
183-
actual_lhs = expr_or_init(cx, actual_lhs);
184-
actual_rhs = expr_or_init(cx, actual_rhs);
181+
let (actual_lhs, lhs_ref_counter) = peel_hir_expr_refs(lhs);
182+
let (actual_rhs, rhs_ref_counter) = peel_hir_expr_refs(rhs);
183+
let actual_lhs = expr_or_init(cx, actual_lhs);
184+
let actual_rhs = expr_or_init(cx, actual_rhs);
185185
let lhs_ty = cx.typeck_results().expr_ty(actual_lhs).peel_refs();
186186
let rhs_ty = cx.typeck_results().expr_ty(actual_rhs).peel_refs();
187187
if self.has_allowed_binary(lhs_ty, rhs_ty) {

clippy_lints/src/suspicious_operation_groupings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ fn ident_difference_expr_with_base_location(
617617
}
618618

619619
let (new_difference, new_base) = ident_difference_via_ident_iter_with_base_location(left, right, base);
620-
base = new_base;
620+
let base = new_base;
621621
difference += new_difference;
622622

623623
(difference, base)

clippy_lints/src/unit_types/unit_arg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ fn fmt_stmts_and_call(
185185
.map(|it| it.as_ref().to_owned())
186186
.collect::<Vec<_>>();
187187
stmts_and_call.push(call_snippet_with_replacements);
188-
stmts_and_call = stmts_and_call
188+
let stmts_and_call: Vec<_> = stmts_and_call
189189
.into_iter()
190190
.map(|v| reindent_multiline(v.into(), true, Some(call_expr_indent)).into_owned())
191191
.collect();

0 commit comments

Comments
 (0)