mirror of
https://git.proxmox.com/git/proxmox
synced 2025-05-01 18:39:52 +00:00
[clippy] macro: ident implements comparsion with strings
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
7f2ae4f272
commit
c241be9e6a
@ -14,7 +14,7 @@ pub type TokenIter = std::iter::Peekable<RawTokenIter>;
|
|||||||
pub fn optional_visibility(tokens: &mut TokenIter) -> Result<syn::Visibility, Error> {
|
pub fn optional_visibility(tokens: &mut TokenIter) -> Result<syn::Visibility, Error> {
|
||||||
// peek:
|
// peek:
|
||||||
if let Some(TokenTree::Ident(ident)) = tokens.peek() {
|
if let Some(TokenTree::Ident(ident)) = tokens.peek() {
|
||||||
if ident.to_string() != "pub" {
|
if ident != "pub" {
|
||||||
return Ok(syn::Visibility::Inherited);
|
return Ok(syn::Visibility::Inherited);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -57,7 +57,7 @@ pub fn match_keyword(
|
|||||||
) -> Result<Span, Error> {
|
) -> Result<Span, Error> {
|
||||||
if let Some(tt) = tokens.next() {
|
if let Some(tt) = tokens.next() {
|
||||||
if let TokenTree::Ident(ident) = tt {
|
if let TokenTree::Ident(ident) = tt {
|
||||||
if ident.to_string() == keyword {
|
if ident == keyword {
|
||||||
return Ok(ident.span());
|
return Ok(ident.span());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user