mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-13 10:11:01 +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> {
|
> Visitor for OptionVisitor<T> {
|
||||||
type Value = Option<T>;
|
type Value = Option<T>;
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
fn visit_unit<E>(&mut self) -> Result<Option<T>, E>
|
||||||
|
where E: Error,
|
||||||
|
{
|
||||||
|
Ok(None)
|
||||||
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn visit_none<E>(&mut self) -> Result<Option<T>, E>
|
fn visit_none<E>(&mut self) -> Result<Option<T>, E>
|
||||||
where E: Error,
|
where E: Error,
|
||||||
|
|||||||
Reference in New Issue
Block a user