Description
As I understand it, the public API currently requires that haystacks be &str
and that all needles be ASCII. Might you consider exposing a way to run a search on a &[u8]
? And possibly also exposing a way to use arbitrary bytes instead of limiting it to ASCII? (I feel less strongly about the latter point than the former point.)
The specific reason why I'd want this is for use in regex
. In particular, the internal matching engines can work on either &str
or &[u8]
, so the prefix literal scanning operates on &[u8]
so that it can be used with any of the matching engines. Since all inputs originate with &str
(currently), I could unsafely transmute to &[u8]
before calling out to jetscii, but I don't think that assumption will always hold in the future and the use of unsafe there seems a little unfortunate.
Other ideas? Thoughts?