Skip to content

Commit

Permalink
Merge pull request #74 from silwol/master
Browse files Browse the repository at this point in the history
Update proc-macro2, quote, syn to version 1
  • Loading branch information
KodrAus authored Oct 10, 2019
2 parents 1968324 + bad8cc4 commit c2ed0a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ license = "Apache-2.0 OR MIT"
proc-macro = true

[dependencies.syn]
version = "0.15"
version = "1"

[dependencies.quote]
version = "0.6"
version = "1"

[dependencies.proc-macro2]
version = "0.4"
version = "1"
8 changes: 4 additions & 4 deletions derive/src/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ pub(crate) fn derive_provider(input: &DeriveInput) -> DeriveProvider {
for meta in list.nested {
match meta {
NestedMeta::Meta(Meta::NameValue(MetaNameValue {
ref ident,
ref path,
lit: Lit::Str(ref s),
..
})) if ident == "derive_from" && s.value() == "serde" => {
})) if path.is_ident("derive_from") && s.value() == "serde" => {
return DeriveProvider::Serde;
}
_ => panic!("unsupported attribute"),
Expand All @@ -39,7 +39,7 @@ pub(crate) fn name_of_field(field: &Field) -> String {
for list in field.attrs.iter().filter_map(sval_attr) {
for meta in list.nested {
if let NestedMeta::Meta(Meta::NameValue(value)) = meta {
if value.ident == "rename" && rename.is_none() {
if value.path.is_ident("rename") && rename.is_none() {
if let Lit::Str(s) = value.lit {
rename = Some(s.value());
continue;
Expand All @@ -59,7 +59,7 @@ fn sval_attr(attr: &Attribute) -> Option<MetaList> {
return None;
}

match attr.interpret_meta() {
match attr.parse_meta().ok() {
Some(Meta::List(list)) => Some(list),
_ => panic!("unsupported attribute"),
}
Expand Down

0 comments on commit c2ed0a1

Please sign in to comment.