1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-23 13:21:38 +03:00

write -> write_all, h/t clippy via @CGMossa

This commit is contained in:
Wez Furlong 2022-01-05 18:52:14 -07:00
parent 2a0de16b7b
commit 41ce7903a9
2 changed files with 3 additions and 3 deletions

View File

@ -564,7 +564,7 @@ mod test {
#[test]
fn socketpair() {
let (mut a, mut b) = super::socketpair_impl().unwrap();
a.write(b"hello").unwrap();
a.write_all(b"hello").unwrap();
let mut buf = [0u8; 5];
assert_eq!(b.read(&mut buf).unwrap(), 5);
assert_eq!(&buf, b"hello");

View File

@ -225,8 +225,8 @@ impl Write for OutputHandle {
}
fn flush(&mut self) -> IoResult<()> {
if self.write_buffer.len() > 0 {
self.handle.write(&self.write_buffer)?;
if !self.write_buffer.is_empty() {
self.handle.write_all(&self.write_buffer)?;
self.write_buffer.clear();
}
Ok(())