Skip to content

Commit

Permalink
Merge pull request #80 from dtolnay/up
Browse files Browse the repository at this point in the history
Update to syn 1.0 and proc-macro2 1.0
  • Loading branch information
mgeisler authored Oct 9, 2019
2 parents 5bc1f48 + d838599 commit 558b00c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 6 additions & 6 deletions src/html_root_url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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),
Expand All @@ -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,
Expand Down

0 comments on commit 558b00c

Please sign in to comment.