Closed
Description
The following code snippet:
extern crate serialize;
fn main() {
let s = serialize::json::encode(&'c');
println!("Encoded: {}, bytes: {}", s, s.as_bytes());
assert_eq!("\"c\"", s.as_slice());
}
Produces the following output:
Encoded: "c", bytes: [34, 99, 0, 0, 0, 34]
task '<main>' panicked at 'assertion failed: `(left == right) && (right == left)` (left: `"c"`, right: `"c"`)', <anon>:6
playpen: application terminated with error code 101
The serialized string should be [34, 99, 34]
, and not [34, 99, 0, 0, 0, 34]
.
Metadata
Metadata
Assignees
Labels
No labels