I have below rust code.
let mut https: Vec<u8>= Vec::new();
https.push(b'/');
When I am running cargo clippy
, I am getting below warning
warning: calls to `push` immediately after creation
https.push(b'/');
^ help: consider using the `vec![]` macro: `let mut https: Vec<u8> = vec![..];`
Can somebody please help me to remove this warning?
Clippy is advising that instead of pushing the new value manually you use the
vec![]
macro to construct a vector with the given items: