diff --git a/src/diff/graph.rs b/src/diff/graph.rs index 2b9ec61bb..7e943f6b8 100644 --- a/src/diff/graph.rs +++ b/src/diff/graph.rs @@ -63,7 +63,7 @@ pub(crate) struct Vertex<'s, 'b> { rhs_parent_id: Option, } -impl<'s, 'b> PartialEq for Vertex<'s, 'b> { +impl PartialEq for Vertex<'_, '_> { fn eq(&self, other: &Self) -> bool { // Strictly speaking, we should compare the whole // EnteredDelimiter stack, not just the immediate @@ -101,9 +101,9 @@ impl<'s, 'b> PartialEq for Vertex<'s, 'b> { b0 && b1 && b2 } } -impl<'s, 'b> Eq for Vertex<'s, 'b> {} +impl Eq for Vertex<'_, '_> {} -impl<'s, 'b> Hash for Vertex<'s, 'b> { +impl Hash for Vertex<'_, '_> { fn hash(&self, state: &mut H) { self.lhs_syntax.map(|node| node.id()).hash(state); self.rhs_syntax.map(|node| node.id()).hash(state); @@ -132,7 +132,7 @@ enum EnteredDelimiter<'s, 'b> { PopBoth((&'s Syntax<'s>, &'s Syntax<'s>)), } -impl<'s, 'b> fmt::Debug for EnteredDelimiter<'s, 'b> { +impl fmt::Debug for EnteredDelimiter<'_, '_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let desc = match self { EnteredDelimiter::PopEither((lhs_delims, rhs_delims)) => { diff --git a/src/diff/sliders.rs b/src/diff/sliders.rs index 2fc2ba671..1100d56ea 100644 --- a/src/diff/sliders.rs +++ b/src/diff/sliders.rs @@ -621,7 +621,7 @@ fn distance_between(prev: &Syntax, next: &Syntax) -> (u32, u32) { (0, 0) } -impl<'a> Syntax<'a> { +impl Syntax<'_> { fn first_line_span(&self) -> Option { match self { List { diff --git a/src/display/json.rs b/src/display/json.rs index 122351bc9..22851cd31 100644 --- a/src/display/json.rs +++ b/src/display/json.rs @@ -170,7 +170,7 @@ impl<'f> From<&'f DiffResult> for File<'f> { } } -impl<'f> Serialize for File<'f> { +impl Serialize for File<'_> { fn serialize(&self, serializer: S) -> Result where S: Serializer, diff --git a/src/parse/syntax.rs b/src/parse/syntax.rs index 406b9e06f..aeefb2866 100644 --- a/src/parse/syntax.rs +++ b/src/parse/syntax.rs @@ -22,7 +22,7 @@ use crate::{ /// A Debug implementation that does not recurse into the /// corresponding node mentioned for Unchanged. Otherwise we will /// infinitely loop on unchanged nodes, which both point to the other. -impl<'a> fmt::Debug for ChangeKind<'a> { +impl fmt::Debug for ChangeKind<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let desc = match self { Unchanged(node) => format!("Unchanged(ID: {})", node.id()), @@ -91,7 +91,7 @@ impl<'a> SyntaxInfo<'a> { } } -impl<'a> Default for SyntaxInfo<'a> { +impl Default for SyntaxInfo<'_> { fn default() -> Self { Self::new() } @@ -591,7 +591,7 @@ fn set_num_ancestors(nodes: &[&Syntax], num_ancestors: u32) { } } -impl<'a> PartialEq for Syntax<'a> { +impl PartialEq for Syntax<'_> { fn eq(&self, other: &Self) -> bool { debug_assert!(self.content_id() > 0); debug_assert!(other.content_id() > 0);