When decoding an empty array, serde_amqp::to_vec returns a 3 byte encoding:
0xE0, 0x01, 0x00
However when encoding this 3 byte encoding, the serde_amqp::from_slice fails because "Err(Io(Custom { kind: UnexpectedEof, error: "Expecting format code" }))"
A simple reproduction is:
let value_to_encode = fe2o3_amqp_types::primitives::Value::Array(fe2o3_amqp_types::primitives::Array::from(vec![]));
let buffer = serde_amqp::to_vec(&value_to_encode).unwrap();
let value: Result<fe2o3_amqp_types::primitives::Value, serde_amqp::error::Error> =
serde_amqp::from_slice(buffer.as_slice());
if value.is_err() {
println!("Error: {:?}", value);
}
assert!(value.is_ok());
Note that if the buffer is 0xE0, 0x02, 0x00, 0x40 the from_slice call succeeds, but if you subsequently call to_vec on the buffer, you get the 0xE0, 0x01, 0x00 output.
When decoding an empty array, serde_amqp::to_vec returns a 3 byte encoding:
0xE0, 0x01, 0x00
However when encoding this 3 byte encoding, the
serde_amqp::from_slice
fails because "Err(Io(Custom { kind: UnexpectedEof, error: "Expecting format code" }))"A simple reproduction is:
Note that if the buffer is
0xE0, 0x02, 0x00, 0x40
thefrom_slice
call succeeds, but if you subsequently callto_vec
on the buffer, you get the0xE0, 0x01, 0x00
output.