2019-10-31 13:32:34 -05:00
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
pub struct GenericTupleStruct<T, U>(T, U);
|
2020-05-05 19:22:53 -05:00
|
|
|
#[doc(hidden)]
|
2019-10-31 13:32:34 -05:00
|
|
|
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
|
2020-06-07 00:41:07 -05:00
|
|
|
const _: () = {
|
2020-05-05 19:22:53 -05:00
|
|
|
#[allow(rust_2018_idioms, clippy::useless_attribute)]
|
2019-10-31 13:32:34 -05:00
|
|
|
extern crate serde as _serde;
|
|
|
|
#[automatically_derived]
|
|
|
|
impl<'de, T, U> _serde::Deserialize<'de> for GenericTupleStruct<T, U>
|
|
|
|
where
|
|
|
|
T: _serde::Deserialize<'de>,
|
|
|
|
U: _serde::Deserialize<'de>,
|
|
|
|
{
|
2021-01-08 21:35:52 -06:00
|
|
|
fn deserialize<__D>(__deserializer: __D) -> _serde::__private::Result<Self, __D::Error>
|
2019-10-31 13:32:34 -05:00
|
|
|
where
|
|
|
|
__D: _serde::Deserializer<'de>,
|
|
|
|
{
|
|
|
|
struct __Visitor<'de, T, U>
|
|
|
|
where
|
|
|
|
T: _serde::Deserialize<'de>,
|
|
|
|
U: _serde::Deserialize<'de>,
|
|
|
|
{
|
2021-01-08 21:35:52 -06:00
|
|
|
marker: _serde::__private::PhantomData<GenericTupleStruct<T, U>>,
|
|
|
|
lifetime: _serde::__private::PhantomData<&'de ()>,
|
2019-10-31 13:32:34 -05:00
|
|
|
}
|
|
|
|
impl<'de, T, U> _serde::de::Visitor<'de> for __Visitor<'de, T, U>
|
|
|
|
where
|
|
|
|
T: _serde::Deserialize<'de>,
|
|
|
|
U: _serde::Deserialize<'de>,
|
|
|
|
{
|
|
|
|
type Value = GenericTupleStruct<T, U>;
|
|
|
|
fn expecting(
|
|
|
|
&self,
|
2021-01-08 21:35:52 -06:00
|
|
|
__formatter: &mut _serde::__private::Formatter,
|
|
|
|
) -> _serde::__private::fmt::Result {
|
|
|
|
_serde::__private::Formatter::write_str(
|
2019-10-31 13:32:34 -05:00
|
|
|
__formatter,
|
|
|
|
"tuple struct GenericTupleStruct",
|
|
|
|
)
|
|
|
|
}
|
|
|
|
#[inline]
|
|
|
|
fn visit_seq<__A>(
|
|
|
|
self,
|
|
|
|
mut __seq: __A,
|
2021-01-08 21:35:52 -06:00
|
|
|
) -> _serde::__private::Result<Self::Value, __A::Error>
|
2019-10-31 13:32:34 -05:00
|
|
|
where
|
|
|
|
__A: _serde::de::SeqAccess<'de>,
|
|
|
|
{
|
|
|
|
let __field0 = match match _serde::de::SeqAccess::next_element::<T>(&mut __seq)
|
|
|
|
{
|
2021-01-08 21:35:52 -06:00
|
|
|
_serde::__private::Ok(__val) => __val,
|
|
|
|
_serde::__private::Err(__err) => {
|
|
|
|
return _serde::__private::Err(__err);
|
2019-10-31 13:32:34 -05:00
|
|
|
}
|
|
|
|
} {
|
2021-01-08 21:35:52 -06:00
|
|
|
_serde::__private::Some(__value) => __value,
|
|
|
|
_serde::__private::None => {
|
|
|
|
return _serde::__private::Err(_serde::de::Error::invalid_length(
|
2019-10-31 13:32:34 -05:00
|
|
|
0usize,
|
|
|
|
&"tuple struct GenericTupleStruct with 2 elements",
|
|
|
|
));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
let __field1 = match match _serde::de::SeqAccess::next_element::<U>(&mut __seq)
|
|
|
|
{
|
2021-01-08 21:35:52 -06:00
|
|
|
_serde::__private::Ok(__val) => __val,
|
|
|
|
_serde::__private::Err(__err) => {
|
|
|
|
return _serde::__private::Err(__err);
|
2019-10-31 13:32:34 -05:00
|
|
|
}
|
|
|
|
} {
|
2021-01-08 21:35:52 -06:00
|
|
|
_serde::__private::Some(__value) => __value,
|
|
|
|
_serde::__private::None => {
|
|
|
|
return _serde::__private::Err(_serde::de::Error::invalid_length(
|
2019-10-31 13:32:34 -05:00
|
|
|
1usize,
|
|
|
|
&"tuple struct GenericTupleStruct with 2 elements",
|
|
|
|
));
|
|
|
|
}
|
|
|
|
};
|
2021-01-08 21:35:52 -06:00
|
|
|
_serde::__private::Ok(GenericTupleStruct(__field0, __field1))
|
2019-10-31 13:32:34 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
_serde::Deserializer::deserialize_tuple_struct(
|
|
|
|
__deserializer,
|
|
|
|
"GenericTupleStruct",
|
|
|
|
2usize,
|
|
|
|
__Visitor {
|
2021-01-08 21:35:52 -06:00
|
|
|
marker: _serde::__private::PhantomData::<GenericTupleStruct<T, U>>,
|
|
|
|
lifetime: _serde::__private::PhantomData,
|
2019-10-31 13:32:34 -05:00
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|
|
|
|
fn deserialize_in_place<__D>(
|
|
|
|
__deserializer: __D,
|
|
|
|
__place: &mut Self,
|
2021-01-08 21:35:52 -06:00
|
|
|
) -> _serde::__private::Result<(), __D::Error>
|
2019-10-31 13:32:34 -05:00
|
|
|
where
|
|
|
|
__D: _serde::Deserializer<'de>,
|
|
|
|
{
|
|
|
|
struct __Visitor<'de, 'place, T: 'place, U: 'place>
|
|
|
|
where
|
|
|
|
T: _serde::Deserialize<'de>,
|
|
|
|
U: _serde::Deserialize<'de>,
|
|
|
|
{
|
|
|
|
place: &'place mut GenericTupleStruct<T, U>,
|
2021-01-08 21:35:52 -06:00
|
|
|
lifetime: _serde::__private::PhantomData<&'de ()>,
|
2019-10-31 13:32:34 -05:00
|
|
|
}
|
|
|
|
impl<'de, 'place, T: 'place, U: 'place> _serde::de::Visitor<'de> for __Visitor<'de, 'place, T, U>
|
|
|
|
where
|
|
|
|
T: _serde::Deserialize<'de>,
|
|
|
|
U: _serde::Deserialize<'de>,
|
|
|
|
{
|
|
|
|
type Value = ();
|
|
|
|
fn expecting(
|
|
|
|
&self,
|
2021-01-08 21:35:52 -06:00
|
|
|
__formatter: &mut _serde::__private::Formatter,
|
|
|
|
) -> _serde::__private::fmt::Result {
|
|
|
|
_serde::__private::Formatter::write_str(
|
2019-10-31 13:32:34 -05:00
|
|
|
__formatter,
|
|
|
|
"tuple struct GenericTupleStruct",
|
|
|
|
)
|
|
|
|
}
|
|
|
|
#[inline]
|
|
|
|
fn visit_seq<__A>(
|
|
|
|
self,
|
|
|
|
mut __seq: __A,
|
2021-01-08 21:35:52 -06:00
|
|
|
) -> _serde::__private::Result<Self::Value, __A::Error>
|
2019-10-31 13:32:34 -05:00
|
|
|
where
|
|
|
|
__A: _serde::de::SeqAccess<'de>,
|
|
|
|
{
|
2021-01-08 21:35:52 -06:00
|
|
|
if let _serde::__private::None = match _serde::de::SeqAccess::next_element_seed(
|
2019-10-31 13:32:34 -05:00
|
|
|
&mut __seq,
|
2021-01-08 21:35:52 -06:00
|
|
|
_serde::__private::de::InPlaceSeed(&mut self.place.0),
|
2019-10-31 13:32:34 -05:00
|
|
|
) {
|
2021-01-08 21:35:52 -06:00
|
|
|
_serde::__private::Ok(__val) => __val,
|
|
|
|
_serde::__private::Err(__err) => {
|
|
|
|
return _serde::__private::Err(__err);
|
2019-10-31 13:32:34 -05:00
|
|
|
}
|
|
|
|
} {
|
2021-01-08 21:35:52 -06:00
|
|
|
return _serde::__private::Err(_serde::de::Error::invalid_length(
|
2019-10-31 13:32:34 -05:00
|
|
|
0usize,
|
|
|
|
&"tuple struct GenericTupleStruct with 2 elements",
|
|
|
|
));
|
|
|
|
}
|
2021-01-08 21:35:52 -06:00
|
|
|
if let _serde::__private::None = match _serde::de::SeqAccess::next_element_seed(
|
2019-10-31 13:32:34 -05:00
|
|
|
&mut __seq,
|
2021-01-08 21:35:52 -06:00
|
|
|
_serde::__private::de::InPlaceSeed(&mut self.place.1),
|
2019-10-31 13:32:34 -05:00
|
|
|
) {
|
2021-01-08 21:35:52 -06:00
|
|
|
_serde::__private::Ok(__val) => __val,
|
|
|
|
_serde::__private::Err(__err) => {
|
|
|
|
return _serde::__private::Err(__err);
|
2019-10-31 13:32:34 -05:00
|
|
|
}
|
|
|
|
} {
|
2021-01-08 21:35:52 -06:00
|
|
|
return _serde::__private::Err(_serde::de::Error::invalid_length(
|
2019-10-31 13:32:34 -05:00
|
|
|
1usize,
|
|
|
|
&"tuple struct GenericTupleStruct with 2 elements",
|
|
|
|
));
|
|
|
|
}
|
2021-01-08 21:35:52 -06:00
|
|
|
_serde::__private::Ok(())
|
2019-10-31 13:32:34 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
_serde::Deserializer::deserialize_tuple_struct(
|
|
|
|
__deserializer,
|
|
|
|
"GenericTupleStruct",
|
|
|
|
2usize,
|
|
|
|
__Visitor {
|
|
|
|
place: __place,
|
2021-01-08 21:35:52 -06:00
|
|
|
lifetime: _serde::__private::PhantomData,
|
2019-10-31 13:32:34 -05:00
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
2019-11-03 06:08:39 -06:00
|
|
|
};
|