diff --git a/nod/src/disc/fst.rs b/nod/src/disc/fst.rs index ea228d1..3e69f90 100644 --- a/nod/src/disc/fst.rs +++ b/nod/src/disc/fst.rs @@ -182,8 +182,7 @@ impl<'a> Fst<'a> { let mut idx = 1; let mut stop_at = None; while let Some(node) = self.nodes.get(idx).copied() { - if self.get_name(node).as_ref().map_or(false, |name| name.eq_ignore_ascii_case(current)) - { + if self.get_name(node).as_ref().is_ok_and(|name| name.eq_ignore_ascii_case(current)) { current = next_non_empty(&mut split); if current.is_empty() { return Some((idx, node)); @@ -221,7 +220,7 @@ pub struct FstIter<'a> { segments: Vec<(Cow<'a, str>, usize)>, } -impl<'a> Iterator for FstIter<'a> { +impl Iterator for FstIter<'_> { type Item = (usize, Node, String); fn next(&mut self) -> Option { diff --git a/nod/src/read.rs b/nod/src/read.rs index ac82c66..219ff38 100644 --- a/nod/src/read.rs +++ b/nod/src/read.rs @@ -212,7 +212,7 @@ pub type FileReader<'a> = WindowedReader<&'a mut dyn PartitionReader>; /// A file reader owning a [`PartitionReader`]. pub type OwnedFileReader = WindowedReader>; -impl<'a> dyn PartitionReader + 'a { +impl dyn PartitionReader + '_ { /// Seeks the partition stream to the specified file system node /// and returns a windowed stream. /// diff --git a/nodtool/build.rs b/nodtool/build.rs index b0b569b..d72e7a8 100644 --- a/nodtool/build.rs +++ b/nodtool/build.rs @@ -91,7 +91,7 @@ fn main() { for (entry, name) in &mut entries { entry.string_table_offset = string_table_offset; out.write_all(entry.as_bytes()).unwrap(); - string_table_offset += name.as_bytes().len() as u32 + 4; + string_table_offset += name.len() as u32 + 4; } // Write string table diff --git a/nodtool/src/util/redump.rs b/nodtool/src/util/redump.rs index 585e07c..4c3ba66 100644 --- a/nodtool/src/util/redump.rs +++ b/nodtool/src/util/redump.rs @@ -134,7 +134,7 @@ pub fn load_dats<'a>(paths: impl Iterator) -> Result<()> { for (entry, name) in &mut entries { entry.string_table_offset = string_table_offset; out.write_all(entry.as_bytes()).unwrap(); - string_table_offset += name.as_bytes().len() as u32 + 4; + string_table_offset += name.len() as u32 + 4; } // Write string table