Skip to content

Commit

Permalink
feat(impls): Allow options to be deserialized from units
Browse files Browse the repository at this point in the history
  • Loading branch information
erickt committed Jan 24, 2016
1 parent da4e37d commit 0a32cea
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions serde/src/de/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0a32cea

Please sign in to comment.