Remove SeqVisitor::end() and MapVisitor::end()

This commit is contained in:
David Tolnay
2017-01-09 00:32:50 -08:00
parent 88a4ed9cd7
commit 88debb3fb8
6 changed files with 83 additions and 170 deletions
+2 -9
View File
@@ -214,11 +214,10 @@ fn deserialize_unit_struct(
}
#[inline]
fn visit_seq<__V>(&mut self, mut visitor: __V) -> ::std::result::Result<#type_ident, __V::Error>
fn visit_seq<__V>(&mut self, _: __V) -> ::std::result::Result<#type_ident, __V::Error>
where __V: _serde::de::SeqVisitor,
{
try!(visitor.end());
self.visit_unit()
Ok(#type_ident)
}
}
@@ -332,7 +331,6 @@ fn deserialize_seq(
let #var = match #visit {
Some(value) => { value },
None => {
try!(visitor.end());
return Err(_serde::de::Error::invalid_length(#index_in_seq));
}
};
@@ -355,9 +353,6 @@ fn deserialize_seq(
quote! {
#(#let_values)*
try!(visitor.end());
Ok(#result)
}
}
@@ -842,8 +837,6 @@ fn deserialize_map(
#match_keys
try!(visitor.end());
#(#extract_values)*
Ok(#struct_path { #(#result),* })