You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm extending serde-json-core for an embedded project to support pretty-formatted serialized strings, tuple variants, and struct variants. It's passing all of the existing tests, except for ser::tests::test_serialize_bytes:
# (Again, my code, not a test error with serde-json-core as-is)
thread 'ser::tests::test_serialize_bytes' panicked at 'assertion failed: `(left == right)` left: `"[49,46,53,54]"`, right: `"1.56"`', src/ser/mod.rs:1996:9
The current method in ser::Serializer just extends the underlying byte buffer:
while the Serde guide serialize_bytes should produce an array:
// Serialize a byte array as an array of bytes. Could also use a base64// string here. Binary formats will typically represent byte arrays more// compactly.fnserialize_bytes(self,v:&[u8]) -> Result<()>{use serde::ser::SerializeSeq;letmut seq = self.serialize_seq(Some(v.len()))?;for byte in v {
seq.serialize_element(byte)?;}
seq.end()}
serde-json also produces a sequence of bytes. It seems like the test_serialize_bytes test shouldn't be passing as it is currently in serde-json-core. Am I missing something about the implementation specific to serde-json-core?
The text was updated successfully, but these errors were encountered:
I'm extending
serde-json-core
for an embedded project to support pretty-formatted serialized strings, tuple variants, and struct variants. It's passing all of the existing tests, except forser::tests::test_serialize_bytes
:The current method in
ser::Serializer
just extends the underlying byte buffer:while the Serde guide
serialize_bytes
should produce an array:serde-json
also produces a sequence of bytes. It seems like thetest_serialize_bytes
test shouldn't be passing as it is currently inserde-json-core
. Am I missing something about the implementation specific toserde-json-core
?The text was updated successfully, but these errors were encountered: