Skip to content

Commit 4851fbd

Browse files
Remove unused field from tuple::Type::Vec
1 parent 55bd37d commit 4851fbd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

xsd-macro-utils/src/tuple.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ enum Type<'a> {
66
Simple(&'a syn::Path),
77
String(&'a syn::Path),
88
Struct(&'a syn::Path),
9-
Vec(&'a syn::Path, &'a syn::Path),
9+
Vec(&'a syn::Path),
1010
}
1111

1212
pub fn serde(ast: &syn::DeriveInput) -> syn::Result<TokenStream> {
@@ -25,7 +25,7 @@ fn from_str(ast: &syn::DeriveInput) -> syn::Result<TokenStream> {
2525
Type::Struct(ty) | Type::Simple(ty) => {
2626
quote! { <#ty as ::std::str::FromStr>::from_str(s).map_err(|e| e.to_string())? }
2727
}
28-
Type::Vec(_, subtype) => match Type::from_path(subtype) {
28+
Type::Vec(subtype) => match Type::from_path(subtype) {
2929
Type::String(subtype) | Type::Struct(subtype) | Type::Simple(subtype) => quote! {
3030
s.split_whitespace()
3131
.filter_map(|s| <#subtype as ::std::str::FromStr>::from_str(s).ok())
@@ -53,7 +53,7 @@ fn display(ast: &syn::DeriveInput) -> syn::Result<TokenStream> {
5353
Type::String(_) | Type::Simple(_) | Type::Struct(_) => quote! {
5454
write!(f, "{}", self.0)
5555
},
56-
Type::Vec(_, subtype) => match Type::from_path(subtype) {
56+
Type::Vec(subtype) => match Type::from_path(subtype) {
5757
Type::String(_) | Type::Simple(_) | Type::Struct(_) => quote! {
5858
let mut it = self.0.iter();
5959
if let Some(val) = it.next() {
@@ -87,7 +87,6 @@ impl Type<'_> {
8787
| "f64" => Type::Simple(path),
8888
"String" => Type::String(path),
8989
"Vec" => Type::Vec(
90-
path,
9190
extract_subtype(path.segments.last().expect("Missing subtype"))
9291
.expect("Vec subtype not found"),
9392
),

0 commit comments

Comments
 (0)