Use multiple pushes in vec_init_then_push example

This commit is contained in:
Alex Macleod 2023-10-23 18:31:35 +00:00
parent 033c763943
commit e1b287c3a6

View File

@ -33,10 +33,12 @@
/// ```no_run /// ```no_run
/// let mut v = Vec::new(); /// let mut v = Vec::new();
/// v.push(0); /// v.push(0);
/// v.push(1);
/// v.push(2);
/// ``` /// ```
/// Use instead: /// Use instead:
/// ```no_run /// ```no_run
/// let v = vec![0]; /// let v = vec![0, 1, 2];
/// ``` /// ```
#[clippy::version = "1.51.0"] #[clippy::version = "1.51.0"]
pub VEC_INIT_THEN_PUSH, pub VEC_INIT_THEN_PUSH,