exhaust/impls/
core_option.rs1use crate::patterns::delegate_factory_and_iter;
2use crate::Exhaust;
3
4impl<T: Exhaust> Exhaust for Option<T> {
5 delegate_factory_and_iter!(remote::Option<T>);
6
7 fn from_factory(factory: Self::Factory) -> Self {
8 match remote::Option::from_factory(factory) {
9 remote::Option::None => None,
10 remote::Option::Some(v) => Some(v),
11 }
12 }
13}
14
15mod remote {
18 #[allow(missing_debug_implementations)] #[derive(crate::Exhaust)]
20 pub enum Option<T> {
21 None,
22 Some(T),
23 }
24}