]> git.proxmox.com Git - cargo.git/blobdiff - vendor/syn/src/attr.rs
New upstream version 0.37.0
[cargo.git] / vendor / syn / src / attr.rs
index ae90eaa3ac70b31cc7b5ae046ed575c1cafde493..da9c121ab4a463f39e9483f5cf04d1a7ecbe47ad 100644 (file)
@@ -600,11 +600,9 @@ pub mod parsing {
 
     impl Parse for NestedMeta {
         fn parse(input: ParseStream) -> Result<Self> {
-            let ahead = input.fork();
-
-            if ahead.peek(Lit) && !(ahead.peek(LitBool) && ahead.peek2(Token![=])) {
+            if input.peek(Lit) && !(input.peek(LitBool) && input.peek2(Token![=])) {
                 input.parse().map(NestedMeta::Literal)
-            } else if ahead.call(Ident::parse_any).is_ok() {
+            } else if private::peek_any_ident(input) {
                 input.parse().map(NestedMeta::Meta)
             } else {
                 Err(input.error("expected identifier or literal"))