Run cargo fix --edition-idioms

This commit is contained in:
Amos Wenger 2022-07-20 15:02:08 +02:00
parent 23d25a3094
commit 816f7fe12a
230 changed files with 888 additions and 888 deletions

View file

@ -432,7 +432,7 @@ impl NameLike {
_ => None,
}
}
pub fn text(&self) -> TokenText {
pub fn text(&self) -> TokenText<'_> {
match self {
NameLike::NameRef(name_ref) => name_ref.text(),
NameLike::Name(name) => name.text(),

View file

@ -38,7 +38,7 @@ impl SyntaxError {
}
impl fmt::Display for SyntaxError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
self.0.fmt(f)
}
}

View file

@ -9,7 +9,7 @@ pub(crate) struct KindsSrc<'a> {
pub(crate) nodes: &'a [&'a str],
}
pub(crate) const KINDS_SRC: KindsSrc = KindsSrc {
pub(crate) const KINDS_SRC: KindsSrc<'_> = KindsSrc {
punct: &[
(";", "SEMICOLON"),
(",", "COMMA"),

View file

@ -42,7 +42,7 @@ impl AsRef<str> for TokenText<'_> {
}
impl From<TokenText<'_>> for String {
fn from(token_text: TokenText) -> Self {
fn from(token_text: TokenText<'_>) -> Self {
token_text.as_str().into()
}
}
@ -53,7 +53,7 @@ impl PartialEq<&'_ str> for TokenText<'_> {
}
}
impl PartialEq<TokenText<'_>> for &'_ str {
fn eq(&self, other: &TokenText) -> bool {
fn eq(&self, other: &TokenText<'_>) -> bool {
other == self
}
}
@ -63,12 +63,12 @@ impl PartialEq<String> for TokenText<'_> {
}
}
impl PartialEq<TokenText<'_>> for String {
fn eq(&self, other: &TokenText) -> bool {
fn eq(&self, other: &TokenText<'_>) -> bool {
other == self
}
}
impl PartialEq for TokenText<'_> {
fn eq(&self, other: &TokenText) -> bool {
fn eq(&self, other: &TokenText<'_>) -> bool {
self.as_str() == other.as_str()
}
}