Fix clippy::only-used-in-recursion

This commit is contained in:
Eric Huss 2025-04-20 19:15:08 -07:00
parent e6b1413d22
commit fbc875dd9f

View file

@ -248,7 +248,7 @@ impl<'a> SummaryParser<'a> {
let mut files = HashSet::new(); let mut files = HashSet::new();
for part in [&prefix_chapters, &numbered_chapters, &suffix_chapters] { for part in [&prefix_chapters, &numbered_chapters, &suffix_chapters] {
self.check_for_duplicates(&part, &mut files)?; Self::check_for_duplicates(&part, &mut files)?;
} }
Ok(Summary { Ok(Summary {
@ -261,7 +261,6 @@ impl<'a> SummaryParser<'a> {
/// Recursively check for duplicate files in the summary items. /// Recursively check for duplicate files in the summary items.
fn check_for_duplicates<'b>( fn check_for_duplicates<'b>(
&self,
items: &'b [SummaryItem], items: &'b [SummaryItem],
files: &mut HashSet<&'b PathBuf>, files: &mut HashSet<&'b PathBuf>,
) -> Result<()> { ) -> Result<()> {
@ -276,7 +275,7 @@ impl<'a> SummaryParser<'a> {
} }
} }
// Recursively check nested items // Recursively check nested items
self.check_for_duplicates(&link.nested_items, files)?; Self::check_for_duplicates(&link.nested_items, files)?;
} }
} }
Ok(()) Ok(())