alpm_mtree::path_decoder

Function octal_triplet

Source
fn octal_triplet(input: &mut &str) -> ModalResult<u8>
Expand description

Parse and convert a single octal triplet string into a byte.

This isn’t a trivial conversion as an octal has three bits and an octal triplet has thereby 9 bits. The highest bit is expected to be always 0. This is ensured via the conversion to u8, which would otherwise overflow and throw an error.