chiark
/
gitweb
/
~ian
/
mastodonochrome.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b01a7ac
)
Clippy fix: use write_all to beep.
author
Simon Tatham
<anakin@pobox.com>
Fri, 5 Jan 2024 22:59:08 +0000
(22:59 +0000)
committer
Simon Tatham
<anakin@pobox.com>
Sat, 6 Jan 2024 08:53:31 +0000
(08:53 +0000)
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!
src/tui.rs
patch
|
blob
|
history
diff --git
a/src/tui.rs
b/src/tui.rs
index 9b6bab9f88e0696207c05a383d8ec9bc0a1c361d..52c90a28f0c04ff6b21042e97cea93d19c953732 100644
(file)
--- 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(())
}
}