From d838599b8129c6ba11ebebe679c0725ce2acb640 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 15 Sep 2019 23:25:20 -0700 Subject: [PATCH] Update to syn 1.0 and proc-macro2 1.0 --- Cargo.toml | 4 ++-- src/html_root_url.rs | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index eea02e6..920cac4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,8 +23,8 @@ codecov = { repository = "mgeisler/version-sync" } [dependencies] pulldown-cmark = { version = "0.4", default-features = false } semver-parser = "0.9" -syn = { version = "0.15", features = ["full"] } -proc-macro2 = { version = "0.4", features = ["span-locations"] } +syn = { version = "1.0", features = ["full"] } +proc-macro2 = { version = "1.0", features = ["span-locations"] } toml = "0.5" url = "1.0" itertools = "0.8" diff --git a/src/html_root_url.rs b/src/html_root_url.rs index b190967..d093f86 100644 --- a/src/html_root_url.rs +++ b/src/html_root_url.rs @@ -80,12 +80,12 @@ pub fn check_html_root_url(path: &str, pkg_name: &str, pkg_version: &str) -> Res if let syn::AttrStyle::Outer = attr.style { continue; } - let (ident, nested_meta_items) = match attr.parse_meta() { - Ok(syn::Meta::List(syn::MetaList { ident, nested, .. })) => (ident, nested), + let (attr_path, nested_meta_items) = match attr.parse_meta() { + Ok(syn::Meta::List(syn::MetaList { path, nested, .. })) => (path, nested), _ => continue, }; - if ident != "doc" { + if !attr_path.is_ident("doc") { continue; } @@ -97,8 +97,8 @@ pub fn check_html_root_url(path: &str, pkg_name: &str, pkg_version: &str) -> Res let check_result = match *meta_item { syn::Meta::NameValue(syn::MetaNameValue { - ref ident, ref lit, .. - }) if ident == "html_root_url" => { + ref path, ref lit, .. + }) if path.is_ident("html_root_url") => { match *lit { // Accept both cooked and raw strings here. syn::Lit::Str(ref s) => url_matches(&s.value(), pkg_name, &version), @@ -108,7 +108,7 @@ pub fn check_html_root_url(path: &str, pkg_name: &str, pkg_version: &str) -> Res _ => continue, } } - syn::Meta::Word(ref name) if name == "html_root_url" => { + syn::Meta::Path(ref path) if path.is_ident("html_root_url") => { Err(String::from("html_root_url attribute without URL")) } _ => continue,