logo
  • Search
  • Reddit Posts 🔥
  • Archive
  • GitHub

New clippy lint: detecting `&mut` which could be `&` in function arguments

233 points imperioland 2023-07-10 15:50:05
View on Reddit ↗

An example:

fn foo(s: &mut Vec<u32>, x: &mut u32) {
    *x += s.len() as u32;
}

In this example, it'll warn for the s argument.

PR is here: https://github.com/rust-lang/rust-clippy/pull/10900

© 2025 Query.rs, built by Folyd with ❤️❤️, see about page to learn more · meiguo.app · aiberm.com