]> git.proxmox.com Git - proxmox.git/commitdiff
[clippy] macro: ident implements comparsion with strings
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 22 Aug 2019 07:20:28 +0000 (09:20 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 22 Aug 2019 07:20:49 +0000 (09:20 +0200)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
proxmox-api-macro/src/parsing.rs

index 0e51c3de3a21be4d32fe815bd4d59a6a1b458f7b..574afeede1dc70f476a2cf9dd741705a380d4a25 100644 (file)
@@ -14,7 +14,7 @@ pub type TokenIter = std::iter::Peekable<RawTokenIter>;
 pub fn optional_visibility(tokens: &mut TokenIter) -> Result<syn::Visibility, Error> {
     // 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<Span, Error> {
     if let Some(tt) = tokens.next() {
         if let TokenTree::Ident(ident) = tt {
-            if ident.to_string() == keyword {
+            if ident == keyword {
                 return Ok(ident.span());
             }
         }