@@ -6,7 +6,7 @@ enum Type<'a> {
6
6
Simple ( & ' a syn:: Path ) ,
7
7
String ( & ' a syn:: Path ) ,
8
8
Struct ( & ' a syn:: Path ) ,
9
- Vec ( & ' a syn:: Path , & ' a syn :: Path ) ,
9
+ Vec ( & ' a syn:: Path ) ,
10
10
}
11
11
12
12
pub fn serde ( ast : & syn:: DeriveInput ) -> syn:: Result < TokenStream > {
@@ -25,7 +25,7 @@ fn from_str(ast: &syn::DeriveInput) -> syn::Result<TokenStream> {
25
25
Type :: Struct ( ty) | Type :: Simple ( ty) => {
26
26
quote ! { <#ty as :: std:: str :: FromStr >:: from_str( s) . map_err( |e| e. to_string( ) ) ? }
27
27
}
28
- Type :: Vec ( _ , subtype) => match Type :: from_path ( subtype) {
28
+ Type :: Vec ( subtype) => match Type :: from_path ( subtype) {
29
29
Type :: String ( subtype) | Type :: Struct ( subtype) | Type :: Simple ( subtype) => quote ! {
30
30
s. split_whitespace( )
31
31
. filter_map( |s| <#subtype as :: std:: str :: FromStr >:: from_str( s) . ok( ) )
@@ -53,7 +53,7 @@ fn display(ast: &syn::DeriveInput) -> syn::Result<TokenStream> {
53
53
Type :: String ( _) | Type :: Simple ( _) | Type :: Struct ( _) => quote ! {
54
54
write!( f, "{}" , self . 0 )
55
55
} ,
56
- Type :: Vec ( _ , subtype) => match Type :: from_path ( subtype) {
56
+ Type :: Vec ( subtype) => match Type :: from_path ( subtype) {
57
57
Type :: String ( _) | Type :: Simple ( _) | Type :: Struct ( _) => quote ! {
58
58
let mut it = self . 0 . iter( ) ;
59
59
if let Some ( val) = it. next( ) {
@@ -87,7 +87,6 @@ impl Type<'_> {
87
87
| "f64" => Type :: Simple ( path) ,
88
88
"String" => Type :: String ( path) ,
89
89
"Vec" => Type :: Vec (
90
- path,
91
90
extract_subtype ( path. segments . last ( ) . expect ( "Missing subtype" ) )
92
91
. expect ( "Vec subtype not found" ) ,
93
92
) ,
0 commit comments