Closed
Description
Scanning a str for ASCII-range codepoints can still be done safely octet-at-a-time, with each indexing operation pulling out a u8 costing only O(1) and producing a value that can be cast and compared to an ASCII-range char.
Indexing on &str
used to return u8
but is now an error: strings do not support indexing at all.
This paragraph will need to be rephrased. Maybe suggest using .as_bytes()
, where the index in the resulting &[u8]
of an ASCII-range byte can safely be used e.g. to slice the original str
.
Metadata
Metadata
Assignees
Labels
No labels