mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-11-08 17:47:05 +00:00
feat(impls): Allow options to be deserialized from units
This commit is contained in:
1 parent
da4e37d3f5
commit
0a32cea26e
1 file changed
+7
@@ -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