From: Simon Tatham Date: Fri, 5 Jan 2024 22:59:08 +0000 (+0000) Subject: Clippy fix: use write_all to beep. X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=b79aecad29ed78d6dfc511bf33e6238e987dfdbc;p=mastodonochrome.git Clippy fix: use write_all to beep. Clippy complains that I used stdout().write(), and although I checked the error code, I didn't also check whether it had written the full buffer or only part of it. But it didn't notice that the buffer was one byte long! --- diff --git a/src/tui.rs b/src/tui.rs index 9b6bab9..52c90a2 100644 --- a/src/tui.rs +++ b/src/tui.rs @@ -402,7 +402,7 @@ impl Tui { } fn beep() -> std::io::Result<()> { - stdout().write(b"\x07")?; + stdout().write_all(b"\x07")?; Ok(()) } }