build: Fix beta clippy issue (useless_vec)

warning: useless use of `vec!`
   --> test_infra/src/lib.rs:111:30
    |
111 |             let mut events = vec![epoll::Event::new(epoll::Events::empty(), 0); 1];
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[epoll::Event::new(epoll::Events::empty(), 0); 1]`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
    = note: `#[warn(clippy::useless_vec)]` on by default

Signed-off-by: Yu Li <liyu.yukiteru@bytedance.com>
This commit is contained in:
Yu Li
2023-07-12 12:25:25 +08:00
committed by Bo Chen
parent aac614e2ec
commit d0dbc7fb4d
4 changed files with 18 additions and 20 deletions

View File

@@ -971,7 +971,7 @@ mod tests {
self.init_pkt(local_port, peer_port, uapi::VSOCK_OP_RESPONSE);
self.send();
let mut buf = vec![0u8; 32];
let mut buf = [0u8; 32];
let len = stream.read(&mut buf[..]).unwrap();
assert_eq!(&buf[..len], format!("OK {local_port}\n").as_bytes());