Auto merge of #5694 - wangtheo:issue-5626, r=matthiaskrgr
#5626: lint iterator.map(|x| x) changelog: adds a new lint for iterator.map(|x| x) (see https://github.com/rust-lang/rust-clippy/issues/5626) The code also lints for result.map(|x| x) and option.map(|x| x). Also, I'm not sure if I'm checking for type adjustments correctly and I can't think of an example where .map(|x| x) would apply type adjustments.
This commit is contained in:
commit
583d644934
10 changed files with 228 additions and 2 deletions
|
|
@ -1144,6 +1144,13 @@ pub static ref ALL_LINTS: Vec<Lint> = vec![
|
|||
deprecation: None,
|
||||
module: "methods",
|
||||
},
|
||||
Lint {
|
||||
name: "map_identity",
|
||||
group: "complexity",
|
||||
desc: "using iterator.map(|x| x)",
|
||||
deprecation: None,
|
||||
module: "map_identity",
|
||||
},
|
||||
Lint {
|
||||
name: "map_unwrap_or",
|
||||
group: "pedantic",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue