nightly clippy fixes

This commit is contained in:
Luke Street 2024-11-22 00:14:51 -07:00
parent f0af954c23
commit a8bc312dd9
4 changed files with 5 additions and 6 deletions

View File

@ -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<Self::Item> {

View File

@ -212,7 +212,7 @@ pub type FileReader<'a> = WindowedReader<&'a mut dyn PartitionReader>;
/// A file reader owning a [`PartitionReader`].
pub type OwnedFileReader = WindowedReader<Box<dyn PartitionReader>>;
impl<'a> dyn PartitionReader + 'a {
impl dyn PartitionReader + '_ {
/// Seeks the partition stream to the specified file system node
/// and returns a windowed stream.
///

View File

@ -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

View File

@ -134,7 +134,7 @@ pub fn load_dats<'a>(paths: impl Iterator<Item = &'a Path>) -> 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