aboutsummaryrefslogtreecommitdiff
path: root/src/ser.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2017-04-28 15:01:08 -0500
committerGitHub <noreply@github.com>2017-04-28 15:01:08 -0500
commit95b3545938f67ca98d313be5c9c8930ee2407a30 (patch)
tree4ec4a2484d45132da883a11b7a1a6700ba06480d /src/ser.rs
parentd8b6c83da660db49949bb484c5e3eeea9642cd8e (diff)
parent082ee7090212e8a377b2145fe82712cc41431fee (diff)
downloadmilf-rs-95b3545938f67ca98d313be5c9c8930ee2407a30.tar.gz
milf-rs-95b3545938f67ca98d313be5c9c8930ee2407a30.zip
Merge pull request #165 from Keats/master
Allow to deserialize/serialize into enums
Diffstat (limited to 'src/ser.rs')
-rw-r--r--src/ser.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ser.rs b/src/ser.rs
index e4b62f7..4896f8a 100644
--- a/src/ser.rs
+++ b/src/ser.rs
@@ -421,9 +421,9 @@ impl<'a, 'b> ser::Serializer for &'b mut Serializer<'a> {
fn serialize_unit_variant(self,
_name: &'static str,
_variant_index: u32,
- _variant: &'static str)
+ variant: &'static str)
-> Result<(), Self::Error> {
- Err(Error::UnsupportedType)
+ self.serialize_str(variant)
}
fn serialize_newtype_struct<T: ?Sized>(self, _name: &'static str, value: &T)