Skip to content

Commit

Permalink
Fix clippy for latest rustc (#692)
Browse files Browse the repository at this point in the history
  • Loading branch information
max-sixty authored Dec 10, 2024
1 parent 657bf07 commit 0cb039d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions insta/src/content/serialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub enum Key<'a> {
Other,
}

impl<'a> Key<'a> {
impl Key<'_> {
/// Needed because [`std::mem::discriminant`] is not [`Ord`]
fn discriminant(&self) -> usize {
match self {
Expand All @@ -35,9 +35,9 @@ impl<'a> Key<'a> {
}
}

impl<'a> Eq for Key<'a> {}
impl Eq for Key<'_> {}

impl<'a> Ord for Key<'a> {
impl Ord for Key<'_> {
fn cmp(&self, other: &Self) -> Ordering {
let self_discriminant = self.discriminant();
let other_discriminant = other.discriminant();
Expand All @@ -58,7 +58,7 @@ impl<'a> Ord for Key<'a> {
}
}

impl<'a> PartialOrd for Key<'a> {
impl PartialOrd for Key<'_> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.cmp(other))
}
Expand Down
4 changes: 2 additions & 2 deletions insta/src/redaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl SelectorParseError {
#[cfg_attr(docsrs, doc(cfg(feature = "redactions")))]
pub struct ContentPath<'a>(&'a [PathItem]);

impl<'a> fmt::Display for ContentPath<'a> {
impl fmt::Display for ContentPath<'_> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
for item in self.0.iter() {
write!(f, ".")?;
Expand All @@ -47,7 +47,7 @@ impl<'a> fmt::Display for ContentPath<'a> {
}

/// Replaces a value with another one.
///
/// Represents a redaction.
#[cfg_attr(docsrs, doc(cfg(feature = "redactions")))]
pub enum Redaction {
Expand Down

0 comments on commit 0cb039d

Please sign in to comment.