Elide lifetimes in more places

Versions of clippy after the MSRV complain about these, and it's fine
on our current Rust version too.
pull/826/head
Wilfred Hughes 2025-03-18 00:27:11 +07:00
parent 0e6c4ba77a
commit ba45a40f71
4 changed files with 9 additions and 9 deletions

@ -63,7 +63,7 @@ pub(crate) struct Vertex<'s, 'b> {
rhs_parent_id: Option<SyntaxId>,
}
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<H: Hasher>(&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)) => {

@ -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<SingleLineSpan> {
match self {
List {

@ -170,7 +170,7 @@ impl<'f> From<&'f DiffResult> for File<'f> {
}
}
impl<'f> Serialize for File<'f> {
impl Serialize for File<'_> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,

@ -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);