pub fn is_binary_bytes(data: &[u8]) -> boolExpand description
Determine if the provided byte slice should be treated as binary.
The heuristic mirrors common implementations used by tools such as ripgrep and git. A slice is considered binary if:
- It contains a NUL byte (
0x00), or - More than 30% of bytes are outside the printable ASCII range.