Is there a way to use the Unicode tables in the Rust regex crate to match a single char without turning it into a String or &str? It seems like the internals must have a way to do this, but perhaps not exposed? Is there a trick?
Hmm. Don't think that would work. You would need to return an array, but we don't have a type for "fixed size array whose contents are guaranteed to be UTF-8."
-
-
I mean once you have the &[u8] can't you read it into a &str? Where would the unsafety come from?
-
I don't think you can get a &[u8] for anything other than ASCII, since the in-memory representation is different between `char` and UTF-8. Would have to be owned
- 6 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.