fix some pedantic clippy lints that make sense

- clippy::redundant-closure-for-method-calls
- clippy::explicit-iter-loop
This commit is contained in:
Antoine Martin 2020-12-17 01:23:10 +01:00
parent 449cdc0157
commit e25bc47f8f
20 changed files with 59 additions and 66 deletions

View file

@ -18,7 +18,7 @@ pub fn run() -> Result<String> {
fn part1(input: &str) -> Result<usize> {
let bag_rules = input
.lines()
.map(|line| line.parse())
.map(str::parse)
.collect::<Result<Vec<BagRule>>>()
.unwrap();
@ -42,7 +42,7 @@ fn part1(input: &str) -> Result<usize> {
fn part2(input: &str) -> Result<usize> {
let bag_rules = input
.lines()
.map(|line| line.parse())
.map(str::parse)
.collect::<Result<Vec<BagRule>>>()
.unwrap();
@ -168,7 +168,7 @@ mod tests {
fn part1_provided_parse() {
let bag_rules = PROVIDED1
.lines()
.map(|line| line.parse())
.map(str::parse)
.collect::<Result<Vec<BagRule>>>()
.unwrap();