Skip to content

Commit 77aca38

Browse files
committed
feat: set is_human_readable to false
This allows implementations of Serialize to change behavior depending on the encoding method used (e.g. encode as base64 for human readable encodings such as JSON, and encode as binary strings for bencode).
1 parent f36b82c commit 77aca38

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/ser.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,10 @@ impl<'a> ser::Serializer for &'a mut Serializer {
213213
type SerializeStruct = SerializeMap<'a>;
214214
type SerializeStructVariant = SerializeMap<'a>;
215215

216+
fn is_human_readable(&self) -> bool {
217+
false
218+
}
219+
216220
fn serialize_bool(self, value: bool) -> Result<()> {
217221
self.serialize_i64(i64::from(value))
218222
}

0 commit comments

Comments
 (0)