Skip to content

Commit 558b00c

Browse files
authored
Merge pull request #80 from dtolnay/up
Update to syn 1.0 and proc-macro2 1.0
2 parents 5bc1f48 + d838599 commit 558b00c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ codecov = { repository = "mgeisler/version-sync" }
2323
[dependencies]
2424
pulldown-cmark = { version = "0.4", default-features = false }
2525
semver-parser = "0.9"
26-
syn = { version = "0.15", features = ["full"] }
27-
proc-macro2 = { version = "0.4", features = ["span-locations"] }
26+
syn = { version = "1.0", features = ["full"] }
27+
proc-macro2 = { version = "1.0", features = ["span-locations"] }
2828
toml = "0.5"
2929
url = "1.0"
3030
itertools = "0.8"

src/html_root_url.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ pub fn check_html_root_url(path: &str, pkg_name: &str, pkg_version: &str) -> Res
8080
if let syn::AttrStyle::Outer = attr.style {
8181
continue;
8282
}
83-
let (ident, nested_meta_items) = match attr.parse_meta() {
84-
Ok(syn::Meta::List(syn::MetaList { ident, nested, .. })) => (ident, nested),
83+
let (attr_path, nested_meta_items) = match attr.parse_meta() {
84+
Ok(syn::Meta::List(syn::MetaList { path, nested, .. })) => (path, nested),
8585
_ => continue,
8686
};
8787

88-
if ident != "doc" {
88+
if !attr_path.is_ident("doc") {
8989
continue;
9090
}
9191

@@ -97,8 +97,8 @@ pub fn check_html_root_url(path: &str, pkg_name: &str, pkg_version: &str) -> Res
9797

9898
let check_result = match *meta_item {
9999
syn::Meta::NameValue(syn::MetaNameValue {
100-
ref ident, ref lit, ..
101-
}) if ident == "html_root_url" => {
100+
ref path, ref lit, ..
101+
}) if path.is_ident("html_root_url") => {
102102
match *lit {
103103
// Accept both cooked and raw strings here.
104104
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
108108
_ => continue,
109109
}
110110
}
111-
syn::Meta::Word(ref name) if name == "html_root_url" => {
111+
syn::Meta::Path(ref path) if path.is_ident("html_root_url") => {
112112
Err(String::from("html_root_url attribute without URL"))
113113
}
114114
_ => continue,

0 commit comments

Comments
 (0)