-
Notifications
You must be signed in to change notification settings - Fork 147
Open
Description
In msgpack-rust-master/rmp/src/encode/mod.rs, the comment indicates that function will panic if ty is negative.
/// # Panics
///
/// Panics if `ty` is negative, because it is reserved for future MessagePack extension including
/// 2-byte type information.
pub fn write_ext_meta<W: RmpWrite>(wr: &mut W, len: u32, ty: i8) -> Result<Marker, ValueWriteError<W::Error>> {
However, following test will not panic, which is inconsistent with comment.
#[test]
fn test(){
let mut buf = [0x00, 0x00];
assert_eq!(Marker::FixExt1, write_ext_meta(&mut &mut buf[..], 1, -1).unwrap());
}
Metadata
Metadata
Assignees
Labels
No labels