MCPcopy Create free account
hub / github.com/RustCrypto/utils / len

Function len

hex-literal/src/lib.rs:42–54  ·  view source on GitHub ↗
(strings: &[&[u8]])

Source from the content-addressed store, hash-verified

40#[doc(hidden)]
41#[must_use]
42pub const fn len(strings: &[&[u8]]) -> usize {
43 let mut i = 0;
44 let mut len = 0;
45 while i < strings.len() {
46 let mut pos = 0;
47 while let Some((_, new_pos)) = next_byte(strings[i], pos) {
48 len += 1;
49 pos = new_pos;
50 }
51 i += 1;
52 }
53 len
54}
55
56/// Decode hex strings into a byte array of pre-computed length.
57///

Callers

nothing calls this directly

Calls 2

next_byteFunction · 0.85
lenMethod · 0.80

Tested by

no test coverage detected