Skip to content

Commit aa79646

Browse files
committed
Update to syn/quote 1.0
1 parent 109a728 commit aa79646

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

soa-derive-internal/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ Internal crate implementation for soa-derive
1616
proc-macro = true
1717

1818
[dependencies]
19-
syn = "0.15"
20-
quote = "0.6"
21-
proc-macro2 = "0.4"
19+
syn = "1"
20+
quote = "1"
21+
proc-macro2 = "1"

soa-derive-internal/src/input.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use proc_macro2::{Span, TokenStream};
2-
use syn::{Data, DeriveInput, Ident, Field, Visibility, Meta, Lit};
2+
use syn::{Data, DeriveInput, Ident, Field, Visibility, Meta, MetaNameValue, Lit};
33
use quote::quote;
44

55
/// Representing the struct we are deriving
@@ -25,16 +25,15 @@ impl Input {
2525

2626
let mut derives: Vec<Ident> = vec![];
2727
for attr in input.attrs {
28-
if let Some(meta) = attr.interpret_meta() {
29-
if meta.name() == "soa_derive" {
30-
if let Meta::NameValue(meta) = meta {
31-
if let Lit::Str(string) = meta.lit {
28+
if let Ok(meta) = attr.parse_meta() {
29+
if meta.path().is_ident("soa_derive") {
30+
match meta {
31+
Meta::NameValue(MetaNameValue{lit: Lit::Str(string), ..}) => {
3232
for value in string.value().split(',') {
3333
derives.push(Ident::new(value.trim(), Span::call_site()));
3434
}
3535
}
36-
} else {
37-
panic!("expected #[soa_derive = \"Traits, To, Derive\"], got {}", "meta TODO")
36+
_ => panic!("expected #[soa_derive = \"Traits, To, Derive\"], got #[{}]", quote!(#meta))
3837
}
3938
}
4039
}

soa-derive-internal/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![recursion_limit="512"]
2-
31
#![warn(clippy::all, clippy::pedantic)]
42
#![allow(clippy::needless_return, clippy::redundant_field_names)]
53
#![allow(clippy::stutter, clippy::use_self)]

0 commit comments

Comments
 (0)