Commit 96c2fc4
committed
Fix clippy::uninit_vec warning
error: calling `set_len()` immediately after reserving a buffer creates uninitialized values
--> futures-util/src/io/buf_reader.rs:52:13
|
52 | let mut buffer = Vec::with_capacity(capacity);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
53 | buffer.set_len(capacity);
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[deny(clippy::uninit_vec)]` on by default
= help: initialize the buffer or wrap the content in `MaybeUninit`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninit_vec1 parent 3601bb7 commit 96c2fc4
1 file changed
+3
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
57 | 54 | | |
58 | 55 | | |
59 | 56 | | |
| |||
0 commit comments