Fix warnings of needless_pass_by_ref_mut in clippy

This commit is contained in:
Guillaume Gomez 2023-06-15 20:53:08 +02:00
parent c62c7fadac
commit dd3e00f102
2 changed files with 6 additions and 6 deletions

View File

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

View File

@ -91,7 +91,7 @@ struct ExistingName {
struct SimilarNamesLocalVisitor<'a, 'tcx> { struct SimilarNamesLocalVisitor<'a, 'tcx> {
names: Vec<ExistingName>, names: Vec<ExistingName>,
cx: &'a EarlyContext<'tcx>, cx: &'a EarlyContext<'tcx>,
lint: &'a NonExpressiveNames, lint: NonExpressiveNames,
/// A stack of scopes containing the single-character bindings in each scope. /// A stack of scopes containing the single-character bindings in each scope.
single_char_names: Vec<Vec<Ident>>, single_char_names: Vec<Vec<Ident>>,
@ -365,7 +365,7 @@ impl EarlyLintPass for NonExpressiveNames {
.. ..
}) = item.kind }) = item.kind
{ {
do_check(self, cx, &item.attrs, &sig.decl, blk); do_check(*self, cx, &item.attrs, &sig.decl, blk);
} }
} }
@ -380,12 +380,12 @@ impl EarlyLintPass for NonExpressiveNames {
.. ..
}) = item.kind }) = item.kind
{ {
do_check(self, cx, &item.attrs, &sig.decl, blk); do_check(*self, cx, &item.attrs, &sig.decl, blk);
} }
} }
} }
fn do_check(lint: &mut NonExpressiveNames, cx: &EarlyContext<'_>, attrs: &[Attribute], decl: &FnDecl, blk: &Block) { fn do_check(lint: NonExpressiveNames, cx: &EarlyContext<'_>, attrs: &[Attribute], decl: &FnDecl, blk: &Block) {
if !attrs.iter().any(|attr| attr.has_name(sym::test)) { if !attrs.iter().any(|attr| attr.has_name(sym::test)) {
let mut visitor = SimilarNamesLocalVisitor { let mut visitor = SimilarNamesLocalVisitor {
names: Vec::new(), names: Vec::new(),