6 ms·
... whoa that's a comprehensive comment. Do you think you could refactor out bytestring-based string manipulation into its own library? Even better would be so
by Manishearth 10y ago
... whoa that's a comprehensive comment.
Do you think you could refactor out bytestring-based string manipulation into its own library? Even better would be something that worked for all encodings (using https://github.com/servo/tendril https://github.com/servo/tendril or something)
- burntsushi 10y ago> Do you think you could refactor out bytestring-based string manipulation into its own library? IIRC, someone was working on making the Pattern trait work on &[u8], but I'm guessing that work is stalled. To factor it out into a separate crate means copying the &str substring routines, since there's no way to safely use them on an &[u8] from the standard library. (bluss did that in the `twoway` crate, so we could just use that.) It does seem like a plausible thing to do, at least until std gets better &[u8] support. > Even better would be something that worked for all encodings I suspect the standard practice here is something like "transcode to UTF-8 and then search the UTF-8." (This is what I hope to do with ripgrep.) > (using https://github.com/servo/tendril https://github.com/servo/tendril or something) I don't think I know what problems tendril is solving, so it's not clear to me what it's role is.