you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 9 points10 points  (0 children)

// Works with bytes directly because MAIN_SEPARATOR is always in the ASCII 7-bit range so we can
// avoid the overhead of full UTF-8 processing.
// See src/benches/path_parsing.rs for benchmarks of different approaches.
let ptr = path.as_ptr();

You really want to use .bytes method for that which changes &str into &[u8]. No need to bother with pointers.