Function contains_zero_byte

Source
const fn contains_zero_byte(x: usize) -> bool
🔬This is a nightly-only experimental API. (slice_internals)
Expand description

Returns true if x contains any zero byte.

From Matters Computational, J. Arndt:

“The idea is to subtract one from each of the bytes and then look for bytes where the borrow propagated all the way to the most significant bit.”