aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2017-02-21 06:21:00 -0800
committerAlex Crichton <alex@alexcrichton.com>2017-02-21 06:21:00 -0800
commitb02e9b9a4a0a074f1de6f3b954caafafd3b3c325 (patch)
tree225e444731fa6a6070791aef4889c1d6c5d73b44 /src
parentccd5de0b83c52d062f2bd3e195a772bde2bf6487 (diff)
downloadmilf-rs-b02e9b9a4a0a074f1de6f3b954caafafd3b3c325.tar.gz
milf-rs-b02e9b9a4a0a074f1de6f3b954caafafd3b3c325.zip
Add support for `serialize_bytes`
Just serialize as a list of numbers. Closes #150
Diffstat (limited to 'src')
-rw-r--r--src/ser.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ser.rs b/src/ser.rs
index 9460704..0b9308d 100644
--- a/src/ser.rs
+++ b/src/ser.rs
@@ -393,8 +393,9 @@ impl<'a, 'b> ser::Serializer for &'b mut Serializer<'a> {
Ok(())
}
- fn serialize_bytes(self, _value: &[u8]) -> Result<(), Self::Error> {
- Err(Error::UnsupportedType)
+ fn serialize_bytes(self, value: &[u8]) -> Result<(), Self::Error> {
+ use serde::ser::Serialize;
+ value.serialize(self)
}
fn serialize_none(self) -> Result<(), Self::Error> {
@@ -1155,7 +1156,7 @@ impl<E: ser::Error> ser::Serializer for Categorize<E> {
}
fn serialize_bytes(self, _: &[u8]) -> Result<Self::Ok, Self::Error> {
- Err(ser::Error::custom("unsupported"))
+ Ok(Category::Array)
}
fn serialize_none(self) -> Result<Self::Ok, Self::Error> {