Skip to content

Commit

Permalink
Fix warnings of needless_pass_by_ref_mut in clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jun 24, 2023
1 parent 335a34d commit 58d6a5d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions clippy_lints/src/literal_representation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ impl LiteralDigitGrouping {
return;
}

if Self::is_literal_uuid_formatted(&mut num_lit) {
if Self::is_literal_uuid_formatted(&num_lit) {
return;
}

Expand Down Expand Up @@ -376,7 +376,7 @@ impl LiteralDigitGrouping {
///
/// Returns `true` if the radix is hexadecimal, and the groups match the
/// 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 {
return false;
}
Expand Down
8 changes: 4 additions & 4 deletions clippy_lints/src/non_expressive_names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ struct ExistingName {
struct SimilarNamesLocalVisitor<'a, 'tcx> {
names: Vec<ExistingName>,
cx: &'a EarlyContext<'tcx>,
lint: &'a NonExpressiveNames,
lint: NonExpressiveNames,

/// A stack of scopes containing the single-character bindings in each scope.
single_char_names: Vec<Vec<Ident>>,
Expand Down Expand Up @@ -365,7 +365,7 @@ impl EarlyLintPass for NonExpressiveNames {
..
}) = item.kind
{
do_check(self, cx, &item.attrs, &sig.decl, blk);
do_check(*self, cx, &item.attrs, &sig.decl, blk);
}
}

Expand All @@ -380,12 +380,12 @@ impl EarlyLintPass for NonExpressiveNames {
..
}) = 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)) {
let mut visitor = SimilarNamesLocalVisitor {
names: Vec::new(),
Expand Down

0 comments on commit 58d6a5d

Please sign in to comment.