BREAKING: Rust flexbuffers serde human readable set to false (#6257)

Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
Casper
2020-11-13 07:53:01 -08:00
committed by GitHub
parent a49531414b
commit ed391e1777
3 changed files with 19 additions and 1 deletions

View File

@@ -217,6 +217,9 @@ impl<'a> ser::Serializer for &'a mut FlexbufferSerializer {
type SerializeStructVariant = &'a mut FlexbufferSerializer;
type Ok = ();
type Error = Error;
fn is_human_readable(&self) -> bool {
cfg!(serialize_human_readable)
}
fn serialize_bool(self, v: bool) -> Result<Self::Ok, Self::Error> {
self.builder.push(v);
self.finish_if_not_nested()

View File

@@ -151,6 +151,10 @@ impl<'de> VariantAccess<'de> for Reader<'de> {
impl<'de> Deserializer<'de> for crate::Reader<'de> {
type Error = DeserializationError;
fn is_human_readable(&self) -> bool {
cfg!(deserialize_human_readable)
}
fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
where
V: Visitor<'de>,