diff options
Diffstat (limited to 'matroska')
-rw-r--r-- | matroska/Cargo.toml | 2 | ||||
-rw-r--r-- | matroska/src/bin/mkvdump.rs | 4 | ||||
-rw-r--r-- | matroska/src/read.rs | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/matroska/Cargo.toml b/matroska/Cargo.toml index f21a779..f4f7b7f 100644 --- a/matroska/Cargo.toml +++ b/matroska/Cargo.toml @@ -7,4 +7,4 @@ edition = "2021" ebml_derive = { path = "../ebml_derive" } log = "0.4.21" env_logger = "0.11.3" -thiserror = "1.0.58" +thiserror = "1.0.61" diff --git a/matroska/src/bin/mkvdump.rs b/matroska/src/bin/mkvdump.rs index b58adcc..c40e325 100644 --- a/matroska/src/bin/mkvdump.rs +++ b/matroska/src/bin/mkvdump.rs @@ -9,9 +9,9 @@ use std::{fs::File, io::BufReader}; fn main() { env_logger::init_from_env("LOG"); let path = std::env::args().nth(1).unwrap(); - let mut r = EbmlReader::new(BufReader::new(File::open(path).unwrap())); + let r = EbmlReader::new(BufReader::new(File::open(path).unwrap())); - while let Some(tag) = r.next() { + for tag in r { let (position, tag) = tag.unwrap(); match tag { MatroskaTag::SimpleBlock(b) | MatroskaTag::Block(b) => { diff --git a/matroska/src/read.rs b/matroska/src/read.rs index 536f2f8..42fbd73 100644 --- a/matroska/src/read.rs +++ b/matroska/src/read.rs @@ -83,7 +83,7 @@ impl EbmlReader { #[inline] pub fn read_utf8(&mut self, size: impl Into<usize>) -> Result<String> { let b = self.read_buf(size)?; - Ok(String::from_utf8(b).map_err(|_| Error::InvalidUTF8)?) + String::from_utf8(b).map_err(|_| Error::InvalidUTF8) } #[inline] @@ -160,7 +160,7 @@ impl EbmlReader { ); self.queue.clear(); self.position = position; - self.inner.seek(SeekFrom::Start(position as u64))?; + self.inner.seek(SeekFrom::Start(position))?; self.stack = path .iter() .map(|id| StackTag { id: *id, end: None }) @@ -257,7 +257,7 @@ impl ReadValue for Vec<u8> { } impl ReadValue for String { fn from_buf(buf: &[u8]) -> Result<Self> { - Ok(String::from_utf8(Vec::from(buf)).map_err(|_| Error::InvalidUTF8)?) + String::from_utf8(Vec::from(buf)).map_err(|_| Error::InvalidUTF8) } } impl ReadValue for Master { |