From c241be9e6afbf36a60c43739c8d4b85d807efca1 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Thu, 22 Aug 2019 09:20:28 +0200 Subject: [PATCH] [clippy] macro: ident implements comparsion with strings Signed-off-by: Wolfgang Bumiller --- proxmox-api-macro/src/parsing.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxmox-api-macro/src/parsing.rs b/proxmox-api-macro/src/parsing.rs index 0e51c3de..574afeed 100644 --- a/proxmox-api-macro/src/parsing.rs +++ b/proxmox-api-macro/src/parsing.rs @@ -14,7 +14,7 @@ pub type TokenIter = std::iter::Peekable; pub fn optional_visibility(tokens: &mut TokenIter) -> Result { // peek: if let Some(TokenTree::Ident(ident)) = tokens.peek() { - if ident.to_string() != "pub" { + if ident != "pub" { return Ok(syn::Visibility::Inherited); } } else { @@ -57,7 +57,7 @@ pub fn match_keyword( ) -> Result { if let Some(tt) = tokens.next() { if let TokenTree::Ident(ident) = tt { - if ident.to_string() == keyword { + if ident == keyword { return Ok(ident.span()); } } -- 2.39.5