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

Function level_clamping

nodedb-codec/src/zstd_codec.rs:343–350  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

341
342 #[test]
343 fn level_clamping() {
344 let data = b"test data for clamping";
345 // Level 0 → clamped to 1, level 99 → clamped to 22.
346 let encoded_low = encode_with_level(data, 0).unwrap();
347 let encoded_high = encode_with_level(data, 99).unwrap();
348 assert_eq!(decode(&encoded_low).unwrap(), data);
349 assert_eq!(decode(&encoded_high).unwrap(), data);
350 }
351}

Callers

nothing calls this directly

Calls 1

encode_with_levelFunction · 0.85

Tested by

no test coverage detected