mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-06-11 03:47:30 +02:00
Use Vec::new instead of vec! (#2712)
Using the `vec!` macro to create an empty `Vec` is a bit weird imo, generally I only see the macro used when you actually want to initialize the `Vec` with some values (like is done in the examples for this exercise). Students are more likely to use `Vec::new`, and I think that's the more idiomatic approach, so I think using `Vec::new` here would be better.
This commit is contained in:
parent
ec75f8f8ab
commit
3726918b87
@ -65,8 +65,8 @@ impl PackageBuilder {
|
||||
Self(Package {
|
||||
name: name.into(),
|
||||
version: "0.1".into(),
|
||||
authors: vec![],
|
||||
dependencies: vec![],
|
||||
authors: Vec::new(),
|
||||
dependencies: Vec::new(),
|
||||
language: None,
|
||||
})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user