mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-06-13 12:56:27 +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 {
|
Self(Package {
|
||||||
name: name.into(),
|
name: name.into(),
|
||||||
version: "0.1".into(),
|
version: "0.1".into(),
|
||||||
authors: vec![],
|
authors: Vec::new(),
|
||||||
dependencies: vec![],
|
dependencies: Vec::new(),
|
||||||
language: None,
|
language: None,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user