In this part of code clippy error message not inline with the intent.
|
let my_empty_vec = vec![1, 2, 3, 4, 5].resize(0, 5); |
|
println!("This Vec is empty, see? {my_empty_vec:?}"); |

Because the solution stated that this is about using clear instead of resize.
|
let mut my_empty_vec = vec![1, 2, 3, 4, 5]; |
|
// `resize` mutates a vector instead of returning a new one. |
|
// `resize(0, …)` clears a vector, so it is better to use `clear`. |
|
my_empty_vec.clear(); |
In this part of code clippy error message not inline with the intent.
rustlings/exercises/22_clippy/clippy3.rs
Lines 20 to 21 in fbfd4f2
Because the solution stated that this is about using
clearinstead ofresize.rustlings/solutions/22_clippy/clippy3.rs
Lines 20 to 23 in fbfd4f2