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

Method encode_less_than_255

src/length.rs:51–55  ·  view source on GitHub ↗
(&mut self, n: usize)

Source from the content-addressed store, hash-verified

49 #[cfg(feature = "arrayvec")]
50 #[inline(always)]
51 pub fn encode_less_than_255(&mut self, n: usize) {
52 use crate::fast::PushUnchecked;
53 debug_assert!(n < 255);
54 unsafe { self.small.push_unchecked(n as u8) };
55 }
56
57 /// Encodes lengths less than `N`. Have to reserve `N * i.size_hint().1 elements`.
58 /// Skips calling encode for T::len() == 0. Returns `true` if it failed due to a length over `N`.

Callers 2

encodeMethod · 0.80
encode_vectoredMethod · 0.80

Calls 1

push_uncheckedMethod · 0.80

Tested by

no test coverage detected