Skip to content

Commit

Permalink
Fix broken test due to breaking change in rust
Browse files Browse the repository at this point in the history
  • Loading branch information
trumank committed Aug 2, 2024
1 parent d1a67fb commit f277c25
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion repak/tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit f277c25

Please sign in to comment.