From aacdbd2504f9d5428a2777b94d17d70c4d378474 Mon Sep 17 00:00:00 2001 From: Carlos Menezes Date: Sun, 7 Apr 2024 16:27:16 +0100 Subject: [PATCH] chore: ci and exclude files --- Cargo.toml | 1 + src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b876d34..62f22d0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,7 @@ name = "img-archive-parser" version = "0.1.0" edition = "2021" +exclude = ["tests/*"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/lib.rs b/src/lib.rs index a753f20..9ee7634 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -34,7 +34,7 @@ impl IMGArchive { } pub fn extract(&mut self, entry: &Entry, writer: &mut W) -> std::io::Result<()> { - let current_pos = self.buffer.seek(SeekFrom::Current(0))?; + let current_pos = self.buffer.stream_position()?; // Every file contained in the img archive must be sector aligned, // where the size of each sector is 2048 bytes. @@ -58,7 +58,7 @@ impl Iterator for IMGArchive { type Item = Result>; fn next(&mut self) -> Option { - let current_pos = match self.buffer.seek(SeekFrom::Current(0)) { + let current_pos = match self.buffer.stream_position() { Ok(pos) => pos, Err(e) => return Some(Err(e.into())), };