imperio ,
@imperio@toot.cat avatar

Added a new rust clippy lint which detects .get().is_some() on std map types:

let s: HashSet<String> = HashSet::new();<br></br>if s.get("a").is_some() {<br></br>

Should be written:

if s.contains("a") {<br></br>

PR: https://github.com/rust-lang/rust-clippy/pull/12339

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • test
  • worldmews
  • mews
  • All magazines