File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -12,5 +12,5 @@ proc-macro = true
1212# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1313
1414[dependencies ]
15- syn = { version = " 1 .0" , features = [" full" ] }
15+ syn = { version = " 2 .0" , features = [" full" ] }
1616quote = " 1.0"
Original file line number Diff line number Diff line change @@ -181,18 +181,21 @@ fn parse_struct_fields(
181181
182182 let mut attrs = Vec :: new ( ) ;
183183 for a in & field. attrs {
184- let simish = if let Some ( i) = a. path . get_ident ( ) {
184+ let simish = if let Some ( i) = a. path ( ) . get_ident ( ) {
185185 attributes. contains ( & i. to_string ( ) . as_str ( ) )
186186 } else {
187187 false
188188 } ;
189189 if simish {
190- let ( name, value) = match a . parse_meta ( ) . unwrap ( ) {
190+ let ( name, value) = match & a . meta {
191191 Meta :: NameValue ( mnv) => {
192192 let name = mnv. path . get_ident ( ) . unwrap ( ) . to_string ( ) ;
193- let value = match mnv. lit {
194- Lit :: Str ( s) => s. value ( ) ,
195- Lit :: Float ( f) => f. base10_digits ( ) . to_string ( ) ,
193+ let value = match & mnv. value {
194+ Expr :: Lit ( l) => match & l. lit {
195+ Lit :: Str ( s) => s. value ( ) ,
196+ Lit :: Float ( f) => f. base10_digits ( ) . to_string ( ) ,
197+ _ => panic ! ( "argument must be a string or float" ) ,
198+ } ,
196199 _ => panic ! ( "argument must be a string or float" ) ,
197200 } ;
198201 ( name, value)
You can’t perform that action at this time.
0 commit comments