aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-03-13 16:54:05 -0500
committerJesse Luehrs <doy@tozt.net>2021-03-13 17:08:19 -0500
commita1abb140c13e214c2406e58f30ab40855875dc30 (patch)
tree1b654c2d04af7caeb1b6d8da8382c968bbf73c80
parent616fddad3e8557d3a4248fd25d00c256eab2c827 (diff)
downloadtextmode-a1abb140c13e214c2406e58f30ab40855875dc30.tar.gz
textmode-a1abb140c13e214c2406e58f30ab40855875dc30.zip
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.
-rw-r--r--src/blocking/input.rs8
-rw-r--r--src/input.rs8
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<bool> {
+ 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<bool> {
+ 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(())
}
}