MCPcopy Create free account
hub / github.com/SoftbearStudios/bitcode / huge_len

Function huge_len

src/length.rs:246–256  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

244 #[cfg(target_pointer_width = "64")] // HUGE_LEN > u32::MAX
245 #[test]
246 fn huge_len() {
247 for (x, is_ok) in [(super::HUGE_LEN - 1, true), (super::HUGE_LEN, false)] {
248 let mut encoder = LengthEncoder::default();
249 encoder.reserve(NonZeroUsize::new(1).unwrap());
250 encoder.encode(&(x as usize));
251 let bytes = encoder.collect();
252
253 let mut decoder = LengthDecoder::default();
254 assert_eq!(decoder.populate(&mut bytes.as_slice(), 1).is_ok(), is_ok);
255 }
256 }
257}

Callers

nothing calls this directly

Calls 3

reserveMethod · 0.45
encodeMethod · 0.45
collectMethod · 0.45

Tested by

no test coverage detected