grade-school: Use `to_vec` instead of `cloned().collect()`
Clippy suggested:
warning: called `cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable
= help: for further information visit
@@ -24,6 +24,6 @@ impl School {
}
pub fn grade(&self, grade: u32) -> Option<Vec<String>> {
- self.grades.get(&grade).map(|v| v.iter().cloned().collect())
+ self.grades.get(&grade).map(|v| v.to_vec())
}
}
