summaryrefslogtreecommitdiff
path: root/src/ser.rs
diff options
context:
space:
mode:
authorPouya Mobasher Behrouz <pooyamb@gmail.com>2020-12-07 05:38:11 +0330
committerGitHub <noreply@github.com>2020-12-06 21:08:11 -0500
commit17642c3735e3a8474919284a15df94ccec9e4da6 (patch)
treeabd22c56c4df2970fcf8561cffdab1976735203a /src/ser.rs
parentf4a0126e62aa87e6a639583ed53aac7655a3f60f (diff)
Support enum unit variants as map keys (#37)
Diffstat (limited to 'src/ser.rs')
-rw-r--r--src/ser.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/ser.rs b/src/ser.rs
index 4fbacd9..50d3688 100644
--- a/src/ser.rs
+++ b/src/ser.rs
@@ -524,14 +524,13 @@ impl ser::Serializer for StringSerializer {
Err(Error::Unsupported)
}
- /// Returns an error.
fn serialize_unit_variant(
self,
_name: &'static str,
_variant_index: u32,
- _variant: &'static str,
+ variant: &'static str,
) -> Result<Self::Ok> {
- Err(Error::Unsupported)
+ Ok(variant.to_string())
}
/// Returns an error.