Attempt to use a non-constant value in a constant

Use vec![Default::default(); n] or Vec::with_capacity(n) and push to it.