const fn unindent_bytes(bytes: &mut [u8]) -> usizeExpand description
This is a reimplementation of the indoc crate’s unindent functionality:
- Count the leading spaces of each line, ignoring the first line and any lines that are empty or contain spaces only.
- Take the minimum.
- If the first line is empty i.e. the string begins with a newline, remove the first line.
- Remove the computed number of spaces from the beginning of each line.