diff --git a/src/internal_macros.rs b/src/internal_macros.rs index 362a2290..6307e330 100644 --- a/src/internal_macros.rs +++ b/src/internal_macros.rs @@ -282,6 +282,28 @@ macro_rules! serde_struct_impl { formatter.write_str("a struct") } + fn visit_seq(self, mut seq: V) -> Result + where + V: $crate::serde::de::SeqAccess<'de>, + { + use $crate::serde::de::Error; + + let length = 0; + $( + let $fe = seq.next_element()?.ok_or_else(|| { + Error::invalid_length(length, &self) + })?; + #[allow(unused_variables)] + let length = length + 1; + )* + + let ret = $name { + $($fe: $fe),* + }; + + Ok(ret) + } + fn visit_map(self, mut map: A) -> Result where A: $crate::serde::de::MapAccess<'de>, @@ -498,6 +520,28 @@ macro_rules! serde_struct_human_string_impl { formatter.write_str("a struct") } + fn visit_seq(self, mut seq: V) -> Result + where + V: $crate::serde::de::SeqAccess<'de>, + { + use $crate::serde::de::Error; + + let length = 0; + $( + let $fe = seq.next_element()?.ok_or_else(|| { + Error::invalid_length(length, &self) + })?; + #[allow(unused_variables)] + let length = length + 1; + )* + + let ret = $name { + $($fe: $fe),* + }; + + Ok(ret) + } + fn visit_map(self, mut map: A) -> Result where A: $crate::serde::de::MapAccess<'de>,