Rust

Rust

Made by DeepSource

Found ref keyword with & reference RS-W1105

Anti-pattern
Minor

Using ref with & in pattern matches is redundant, as they cancel each other out. Furthermore, &ref would break for types which are being moved rather than just referenced.

Bad practice

let mut v = Vec::<String>::new();
v.iter_mut().filter(|&ref a| a.is_empty());

Recommended

let mut v = Vec::<String>::new();
v.iter_mut().filter(|a| a.is_empty());