Merge branch 'origin/1.0' into 'origin/remote'
Conflicts: serde_derive/src/de.rs
This commit is contained in:
commit
78f682590a
@ -234,13 +234,6 @@ fn deserialize_unit_struct(params: &Parameters, item_attrs: &attr::Item) -> Frag
|
|||||||
{
|
{
|
||||||
_serde::export::Ok(#this)
|
_serde::export::Ok(#this)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn visit_seq<__V>(self, _: __V) -> _serde::export::Result<Self::Value, __V::Error>
|
|
||||||
where __V: _serde::de::SeqVisitor<'de>
|
|
||||||
{
|
|
||||||
_serde::export::Ok(#this)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_serde::Deserializer::deserialize_unit_struct(__deserializer, #type_name, __Visitor)
|
_serde::Deserializer::deserialize_unit_struct(__deserializer, #type_name, __Visitor)
|
||||||
|
@ -242,14 +242,6 @@ declare_tests! {
|
|||||||
UnitStruct => &[
|
UnitStruct => &[
|
||||||
Token::UnitStruct("UnitStruct"),
|
Token::UnitStruct("UnitStruct"),
|
||||||
],
|
],
|
||||||
UnitStruct => &[
|
|
||||||
Token::Seq(Some(0)),
|
|
||||||
Token::SeqEnd,
|
|
||||||
],
|
|
||||||
UnitStruct => &[
|
|
||||||
Token::Seq(None),
|
|
||||||
Token::SeqEnd,
|
|
||||||
],
|
|
||||||
}
|
}
|
||||||
test_newtype_struct {
|
test_newtype_struct {
|
||||||
NewtypeStruct(1) => &[
|
NewtypeStruct(1) => &[
|
||||||
@ -1036,4 +1028,11 @@ declare_error_tests! {
|
|||||||
],
|
],
|
||||||
Error::Message("invalid type: floating point `0`, expected isize".into()),
|
Error::Message("invalid type: floating point `0`, expected isize".into()),
|
||||||
}
|
}
|
||||||
|
test_unit_struct_from_seq<UnitStruct> {
|
||||||
|
&[
|
||||||
|
Token::Seq(Some(0)),
|
||||||
|
Token::SeqEnd,
|
||||||
|
],
|
||||||
|
Error::Message("invalid type: sequence, expected unit struct UnitStruct".into()),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user