From 9d1034630e542f277fd4bbfaac29267a301c33b3 Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Sun, 18 Aug 2024 19:28:06 -0300 Subject: [PATCH] fix some clippy complaints --- src/csl/mod.rs | 2 +- src/lib.rs | 4 +--- tests/archiver.rs | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/csl/mod.rs b/src/csl/mod.rs index 6206275..69d269d 100644 --- a/src/csl/mod.rs +++ b/src/csl/mod.rs @@ -129,7 +129,7 @@ impl<'a, T: EntryLike + Hash + PartialEq + Eq + Debug> BibliographyDriver<'a, T> &mut citation.items, style.csl.citation.sort.as_ref(), citation.locale.as_ref(), - &citation_number, + citation_number, ); let items = &citation.items; diff --git a/src/lib.rs b/src/lib.rs index ada473b..fe78df8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -610,9 +610,7 @@ impl Entry { // Index parents with the items in path. If, at any level, the index // exceeds the number of parents, increment the index at the // previous level. If no other level remains, return. - let Some(first_path) = path.first() else { - return None; - }; + let first_path = path.first()?; if self.parents.len() <= *first_path { return None; diff --git a/tests/archiver.rs b/tests/archiver.rs index 81007f0..7876ae3 100644 --- a/tests/archiver.rs +++ b/tests/archiver.rs @@ -289,7 +289,7 @@ fn get_names<'a>(id: &'a str, over: Option<&'a Override>) -> Vec { } .to_string(); - let other = if let Some(alias) = over.and_then(|o| o.alias) { alias } else { &[] }; + let other = over.and_then(|o| o.alias).unwrap_or_default(); iter::once(main) .chain(other.iter().map(ToString::to_string)) .collect()