[fix] UnexpectedEof is ok and should not show an error

This commit is contained in:
ddidderr 2022-08-04 18:50:47 +02:00
parent 91ec9ab7ec
commit 070d07b27c
Signed by: ddidderr
GPG Key ID: 3841F1C27E6F0E14

View File

@ -55,7 +55,13 @@ fn run() -> LogtimesResult {
loop { loop {
// read 1 char // read 1 char
input.read_exact(&mut buf)?; if let Err(e) = input.read_exact(&mut buf) {
if e.kind() == ErrorKind::UnexpectedEof {
return Ok(());
} else {
return Err(e);
}
}
// push that char to the "current line" buffer // push that char to the "current line" buffer
linebuf.push(buf[0]); linebuf.push(buf[0]);