From df5e22af61a6e842677121746912959ce955de2c Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Sat, 1 Feb 2025 18:49:42 -0300 Subject: [PATCH] apply clippy 1.83.0 suggestions --- src/csl/mod.rs | 2 +- src/csl/rendering/mod.rs | 2 +- src/csl/sort.rs | 2 +- src/csl/taxonomy.rs | 2 +- src/types/numeric.rs | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/csl/mod.rs b/src/csl/mod.rs index ce8a984a..8ac6a330 100644 --- a/src/csl/mod.rs +++ b/src/csl/mod.rs @@ -91,7 +91,7 @@ impl<'a, T: EntryLike> BibliographyDriver<'a, T> { } /// Implementations for finishing the bibliography. -impl<'a, T: EntryLike + Hash + PartialEq + Eq + Debug> BibliographyDriver<'a, T> { +impl BibliographyDriver<'_, T> { /// Render the bibliography. pub fn finish(mut self, request: BibliographyRequest<'_>) -> Rendered { // 1. Assign citation numbers by bibliography ordering or by citation diff --git a/src/csl/rendering/mod.rs b/src/csl/rendering/mod.rs index e4afc126..e15f37ef 100644 --- a/src/csl/rendering/mod.rs +++ b/src/csl/rendering/mod.rs @@ -975,7 +975,7 @@ impl<'a, 'b, T: EntryLike> BranchConditionIter<'a, 'b, T> { } } -impl<'a, 'b, T: EntryLike> Iterator for BranchConditionIter<'a, 'b, T> { +impl Iterator for BranchConditionIter<'_, '_, T> { type Item = bool; fn next(&mut self) -> Option { diff --git a/src/csl/sort.rs b/src/csl/sort.rs index cab43dcf..2783563b 100644 --- a/src/csl/sort.rs +++ b/src/csl/sort.rs @@ -12,7 +12,7 @@ use crate::csl::BufWriteFormat; use super::taxonomy::EntryLike; use super::{CitationItem, InstanceContext, StyleContext}; -impl<'a> StyleContext<'a> { +impl StyleContext<'_> { /// Retrieve the ordering of two entries according to the given sort key. fn cmp_entries( &self, diff --git a/src/csl/taxonomy.rs b/src/csl/taxonomy.rs index de98feb3..c3b8c7f8 100644 --- a/src/csl/taxonomy.rs +++ b/src/csl/taxonomy.rs @@ -159,7 +159,7 @@ impl EntryLike for Entry { NumberVariable::Issue => self.map(|e| e.issue()).map(MaybeTyped::to_cow), NumberVariable::Locator => panic!("processor must resolve this"), NumberVariable::Number => { - return self.serial_number().and_then(|s| s.0.get("serial")).map(|s| { + self.serial_number().and_then(|s| s.0.get("serial")).map(|s| { Numeric::from_str(s) .map(|n| MaybeTyped::Typed(Cow::Owned(n))) .unwrap_or_else(|_| MaybeTyped::String(s.to_owned())) diff --git a/src/types/numeric.rs b/src/types/numeric.rs index b242d5f4..693af3bc 100644 --- a/src/types/numeric.rs +++ b/src/types/numeric.rs @@ -32,7 +32,7 @@ impl<'de> Deserialize<'de> for Numeric { struct OurVisitor; /// The visitor parses numbers and strings. - impl<'de> Visitor<'de> for OurVisitor { + impl Visitor<'_> for OurVisitor { type Value = Numeric; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -230,7 +230,7 @@ impl Numeric { } } -impl<'a> MaybeTyped> { +impl MaybeTyped> { /// Order the values according to CSL rules. pub(crate) fn csl_cmp(&self, other: &Self) -> std::cmp::Ordering { match (self, other) { @@ -379,7 +379,7 @@ pub struct NumIterator<'a> { idx: usize, } -impl<'a> Iterator for NumIterator<'a> { +impl Iterator for NumIterator<'_> { type Item = i32; fn next(&mut self) -> Option { @@ -394,7 +394,7 @@ impl<'a> Iterator for NumIterator<'a> { } } -impl<'a> ExactSizeIterator for NumIterator<'a> { +impl ExactSizeIterator for NumIterator<'_> { fn len(&self) -> usize { self.size_hint().0 }