From a1abb140c13e214c2406e58f30ab40855875dc30 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 13 Mar 2021 16:54:05 -0500 Subject: remove unused return value getc is what will return None on eof when it sees that the internal buffer is empty after calling fill_buf. --- src/blocking/input.rs | 8 ++++---- src/input.rs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/blocking/input.rs b/src/blocking/input.rs index c668857..771bed4 100644 --- a/src/blocking/input.rs +++ b/src/blocking/input.rs @@ -225,13 +225,13 @@ impl Input { } } - fn fill_buf(&mut self) -> Result { + fn fill_buf(&mut self) -> Result<()> { if self.buf_is_empty() { self.buf.resize(4096, 0); self.pos = 0; let bytes = read_stdin(&mut self.buf)?; if bytes == 0 { - return Ok(false); + return Ok(()); } self.buf.truncate(bytes); } @@ -244,7 +244,7 @@ impl Input { while cur < self.pos + expected_bytes { let bytes = read_stdin(&mut self.buf[cur..])?; if bytes == 0 { - return Ok(false); + return Ok(()); } cur += bytes; } @@ -252,7 +252,7 @@ impl Input { } } - Ok(true) + Ok(()) } } diff --git a/src/input.rs b/src/input.rs index bd10b86..4ecd899 100644 --- a/src/input.rs +++ b/src/input.rs @@ -239,13 +239,13 @@ impl Input { } } - async fn fill_buf(&mut self) -> Result { + async fn fill_buf(&mut self) -> Result<()> { if self.buf_is_empty() { self.buf.resize(4096, 0); self.pos = 0; let bytes = read_stdin(&mut self.stdin, &mut self.buf).await?; if bytes == 0 { - return Ok(false); + return Ok(()); } self.buf.truncate(bytes); } @@ -260,7 +260,7 @@ impl Input { read_stdin(&mut self.stdin, &mut self.buf[cur..]) .await?; if bytes == 0 { - return Ok(false); + return Ok(()); } cur += bytes; } @@ -268,7 +268,7 @@ impl Input { } } - Ok(true) + Ok(()) } } -- cgit v1.2.3