Skip to content

Commit dd3e00f

Browse files
Fix warnings of needless_pass_by_ref_mut in clippy
1 parent c62c7fa commit dd3e00f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

clippy_lints/src/literal_representation.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ impl LiteralDigitGrouping {
264264
return;
265265
}
266266

267-
if Self::is_literal_uuid_formatted(&mut num_lit) {
267+
if Self::is_literal_uuid_formatted(&num_lit) {
268268
return;
269269
}
270270

@@ -376,7 +376,7 @@ impl LiteralDigitGrouping {
376376
///
377377
/// Returns `true` if the radix is hexadecimal, and the groups match the
378378
/// UUID format of 8-4-4-4-12.
379-
fn is_literal_uuid_formatted(num_lit: &mut NumericLiteral<'_>) -> bool {
379+
fn is_literal_uuid_formatted(num_lit: &NumericLiteral<'_>) -> bool {
380380
if num_lit.radix != Radix::Hexadecimal {
381381
return false;
382382
}

clippy_lints/src/non_expressive_names.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ struct ExistingName {
9191
struct SimilarNamesLocalVisitor<'a, 'tcx> {
9292
names: Vec<ExistingName>,
9393
cx: &'a EarlyContext<'tcx>,
94-
lint: &'a NonExpressiveNames,
94+
lint: NonExpressiveNames,
9595

9696
/// A stack of scopes containing the single-character bindings in each scope.
9797
single_char_names: Vec<Vec<Ident>>,
@@ -365,7 +365,7 @@ impl EarlyLintPass for NonExpressiveNames {
365365
..
366366
}) = item.kind
367367
{
368-
do_check(self, cx, &item.attrs, &sig.decl, blk);
368+
do_check(*self, cx, &item.attrs, &sig.decl, blk);
369369
}
370370
}
371371

@@ -380,12 +380,12 @@ impl EarlyLintPass for NonExpressiveNames {
380380
..
381381
}) = item.kind
382382
{
383-
do_check(self, cx, &item.attrs, &sig.decl, blk);
383+
do_check(*self, cx, &item.attrs, &sig.decl, blk);
384384
}
385385
}
386386
}
387387

388-
fn do_check(lint: &mut NonExpressiveNames, cx: &EarlyContext<'_>, attrs: &[Attribute], decl: &FnDecl, blk: &Block) {
388+
fn do_check(lint: NonExpressiveNames, cx: &EarlyContext<'_>, attrs: &[Attribute], decl: &FnDecl, blk: &Block) {
389389
if !attrs.iter().any(|attr| attr.has_name(sym::test)) {
390390
let mut visitor = SimilarNamesLocalVisitor {
391391
names: Vec::new(),

0 commit comments

Comments
 (0)