MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / compact_integer_encoding

Function compact_integer_encoding

nodedb-query/src/msgpack_scan/writer.rs:335–350  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

333
334 #[test]
335 fn compact_integer_encoding() {
336 // Positive fixint
337 let mut buf = Vec::new();
338 write_i64(&mut buf, 42);
339 assert_eq!(buf, vec![42]);
340
341 // Negative fixint
342 buf.clear();
343 write_i64(&mut buf, -1);
344 assert_eq!(buf, vec![0xFF]);
345
346 // int8
347 buf.clear();
348 write_i64(&mut buf, -100);
349 assert_eq!(buf, vec![0xD0, (-100i8) as u8]);
350 }
351}

Callers

nothing calls this directly

Calls 2

write_i64Function · 0.85
clearMethod · 0.45

Tested by

no test coverage detected