From 5580dd6e6acf9626f86cdec5fa575e48db9c7209 Mon Sep 17 00:00:00 2001 From: Bo Chen Date: Tue, 6 Feb 2024 14:46:10 -0800 Subject: [PATCH] tests: Avoid clippy warning of unhandled I/O bytes Fixes beta clippy issue: error: read amount is not handled --> tests/integration.rs:2121:15 | 2121 | match pty.read(&mut buf) { | ^^^^^^^^^^^^^^^^^^ | = help: use `Read::read_exact` instead, or handle partial reads note: the result is consumed here, but the amount of I/O bytes remains unhandled --> tests/integration.rs:2122:13 | 2122 | / Ok(_) => { 2123 | | let output = std::str::from_utf8(&buf).unwrap().to_string(); 2124 | | match tx.send(output) { 2125 | | Ok(_) => (), 2126 | | Err(_) => break, 2127 | | } 2128 | | } | |_____________^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_io_amount = note: `#[deny(clippy::unused_io_amount)]` on by default Signed-off-by: Bo Chen (cherry picked from commit 36890373cd814c074f26a5b2db000c171104e5bd) --- tests/integration.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration.rs b/tests/integration.rs index 2b9c3a863..77500e157 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -2118,7 +2118,7 @@ fn pty_read(mut pty: std::fs::File) -> Receiver { thread::sleep(std::time::Duration::new(1, 0)); let mut buf = [0; 512]; match pty.read(&mut buf) { - Ok(_) => { + Ok(_bytes) => { let output = std::str::from_utf8(&buf).unwrap().to_string(); match tx.send(output) { Ok(_) => (),