mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-25 03:27:56 +00:00
feat(impls): Allow options to be deserialized from units
This commit is contained in:
@@ -283,6 +283,13 @@ impl<
|
||||
> Visitor for OptionVisitor<T> {
|
||||
type Value = Option<T>;
|
||||
|
||||
#[inline]
|
||||
fn visit_unit<E>(&mut self) -> Result<Option<T>, E>
|
||||
where E: Error,
|
||||
{
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn visit_none<E>(&mut self) -> Result<Option<T>, E>
|
||||
where E: Error,
|
||||
|
||||
Reference in New Issue
Block a user