mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-16 00:20:46 +00:00
Run cargo fix --edition-idioms
This commit is contained in:
parent
23d25a3094
commit
816f7fe12a
230 changed files with 888 additions and 888 deletions
|
@ -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(),
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue