fix: Build with stable rust

This commit is contained in:
DanSnow 2019-10-14 15:29:29 +08:00
parent cfd06a7b80
commit 33a19dc2c2
No known key found for this signature in database
GPG Key ID: 2B25949174178EBD
1 changed files with 11 additions and 9 deletions

View File

@ -69,15 +69,17 @@ impl Args {
let mut guards = Vec::new(); let mut guards = Vec::new();
for arg in args { for arg in args {
match arg { match arg {
NestedMeta::Lit(syn::Lit::Str(lit)) if path.is_none() => { NestedMeta::Lit(syn::Lit::Str(lit)) => match path {
path = Some(lit); None => {
} path = Some(lit);
NestedMeta::Lit(syn::Lit::Str(lit)) if path.is_some() => { }
return Err(syn::Error::new_spanned( _ => {
lit, return Err(syn::Error::new_spanned(
"Multiple paths specified! Should be only one!", lit,
)); "Multiple paths specified! Should be only one!",
} ));
}
},
NestedMeta::Meta(syn::Meta::NameValue(nv)) => { NestedMeta::Meta(syn::Meta::NameValue(nv)) => {
if nv.path.is_ident("guard") { if nv.path.is_ident("guard") {
if let syn::Lit::Str(lit) = nv.lit { if let syn::Lit::Str(lit) = nv.lit {