serde/test_suite/tests/expand/named_unit.expanded.rs

53 lines
1.9 KiB
Rust
Raw Normal View History

2019-10-31 13:32:34 -05:00
use serde::{Deserialize, Serialize};
struct NamedUnit;
#[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 _: () = {
#[allow(rust_2018_idioms, clippy::useless_attribute)]
2019-10-31 13:32:34 -05:00
extern crate serde as _serde;
#[automatically_derived]
impl _serde::Serialize for NamedUnit {
fn serialize<__S>(
&self,
__serializer: __S,
) -> _serde::__private::Result<__S::Ok, __S::Error>
2019-10-31 13:32:34 -05:00
where
__S: _serde::Serializer,
{
_serde::Serializer::serialize_unit_struct(__serializer, "NamedUnit")
}
}
};
#[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 _: () = {
#[allow(rust_2018_idioms, clippy::useless_attribute)]
2019-10-31 13:32:34 -05:00
extern crate serde as _serde;
#[automatically_derived]
impl<'de> _serde::Deserialize<'de> for NamedUnit {
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;
impl<'de> _serde::de::Visitor<'de> for __Visitor {
type Value = NamedUnit;
fn expecting(
&self,
__formatter: &mut _serde::__private::Formatter,
) -> _serde::__private::fmt::Result {
_serde::__private::Formatter::write_str(__formatter, "unit struct NamedUnit")
2019-10-31 13:32:34 -05:00
}
#[inline]
fn visit_unit<__E>(self) -> _serde::__private::Result<Self::Value, __E>
2019-10-31 13:32:34 -05:00
where
__E: _serde::de::Error,
{
_serde::__private::Ok(NamedUnit)
2019-10-31 13:32:34 -05:00
}
}
_serde::Deserializer::deserialize_unit_struct(__deserializer, "NamedUnit", __Visitor)
}
}
};