Deserialize Bound::Unbounded as unit variant

This commit is contained in:
David Tolnay 2019-02-01 21:00:52 -08:00
parent 8463bfc1e5
commit 3a097ff2d2
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -2365,7 +2365,7 @@ where
A: EnumAccess<'de>,
{
match try!(data.variant()) {
(Field::Unbounded, v) => v.newtype_variant().map(|_: T| Bound::Unbounded),
(Field::Unbounded, v) => v.unit_variant().map(|()| Bound::Unbounded),
(Field::Included, v) => v.newtype_variant().map(Bound::Included),
(Field::Excluded, v) => v.newtype_variant().map(Bound::Excluded),
}