diff --git a/serde/src/de/impls.rs b/serde/src/de/impls.rs index 1e5f5770..ef696484 100644 --- a/serde/src/de/impls.rs +++ b/serde/src/de/impls.rs @@ -283,6 +283,13 @@ impl< > Visitor for OptionVisitor { type Value = Option; + #[inline] + fn visit_unit(&mut self) -> Result, E> + where E: Error, + { + Ok(None) + } + #[inline] fn visit_none(&mut self) -> Result, E> where E: Error,