Skip to content

Commit

Permalink
apply clippy 1.83.0 suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
PgBiel committed Feb 1, 2025
1 parent 7708e4a commit df5e22a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/csl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T: EntryLike + Hash + PartialEq + Eq + Debug> BibliographyDriver<'_, T> {
/// Render the bibliography.
pub fn finish(mut self, request: BibliographyRequest<'_>) -> Rendered {
// 1. Assign citation numbers by bibliography ordering or by citation
Expand Down
2 changes: 1 addition & 1 deletion src/csl/rendering/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T: EntryLike> Iterator for BranchConditionIter<'_, '_, T> {
type Item = bool;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
2 changes: 1 addition & 1 deletion src/csl/sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T: EntryLike>(
&self,
Expand Down
2 changes: 1 addition & 1 deletion src/csl/taxonomy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
Expand Down
8 changes: 4 additions & 4 deletions src/types/numeric.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -230,7 +230,7 @@ impl Numeric {
}
}

impl<'a> MaybeTyped<Cow<'a, Numeric>> {
impl MaybeTyped<Cow<'_, Numeric>> {
/// Order the values according to CSL rules.
pub(crate) fn csl_cmp(&self, other: &Self) -> std::cmp::Ordering {
match (self, other) {
Expand Down Expand Up @@ -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<Self::Item> {
Expand All @@ -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
}
Expand Down

0 comments on commit df5e22a

Please sign in to comment.