mirror of
https://github.com/xavo95/repak.git
synced 2025-02-22 07:53:45 +00:00
Fix broken test due to breaking change in rust
This commit is contained in:
parent
d1a67fb99a
commit
f277c25b3c
1 changed files with 8 additions and 1 deletions
|
@ -46,12 +46,19 @@ where
|
|||
let read = self.inner.read(buf);
|
||||
if let Ok(read) = read {
|
||||
for _ in 0..read {
|
||||
let save = self.reads.position();
|
||||
let r = match self.reads.read_u8() {
|
||||
Ok(r) => {
|
||||
self.reads.seek(SeekFrom::Current(-1)).unwrap();
|
||||
Ok(r)
|
||||
}
|
||||
Err(ref e) if e.kind() == io::ErrorKind::UnexpectedEof => Ok(0),
|
||||
Err(ref e) if e.kind() == io::ErrorKind::UnexpectedEof => {
|
||||
// since rust 1.80 read_exact will move cursor position to end of internal
|
||||
// buffer so we have to reset it
|
||||
// ref https://github.com/rust-lang-ci/rust/commit/67b37f5054e4508694b7bd0b766e27f64cbd2d7f
|
||||
self.reads.seek(SeekFrom::Start(save)).unwrap();
|
||||
Ok(0)
|
||||
}
|
||||
Err(e) => Err(e),
|
||||
}
|
||||
.unwrap();
|
||||
|
|
Loading…
Reference in a new issue