add BytePattern for searching &[u8]#134350
add BytePattern for searching &[u8]#134350folkertdev wants to merge 1 commit intorust-lang:masterfrom
BytePattern for searching &[u8]#134350Conversation
|
r? @ibraheemdev rustbot has assigned @ibraheemdev. Use |
This comment has been minimized.
This comment has been minimized.
7166fbd to
885dbd0
Compare
Just a drive-by comment for now, but I believe there is and ought to be only one behavior difference, and it only applies when the needle is the empty string. In the Apologies if you already knew this, but it's subtle and wanted to flag it. And also say that there shouldn't be any other behavior differences. |
|
This is a lot of code that I'm not very familiar with so I'm going to pass this one on (feel free to take this one @BurntSushi if you are up for it). r? libs |
|
Yeah makes sense, If there is a decent way of making this PR smaller we can look at that too.
Yes, I hope I've found all the places where that matters. From what I can see, the So maybe a better first PR is to move |
|
I'll close this in favor of #135931 and other followups that break this change up into more manageable pieces |
tracking issue: #134149
Right now, this duplicates a fair amount of code from
core::str::pattern, to make sure that there isn't some sneaky interaction with utf8 boundaries. I think it is possible to shareTwoWaySearcher, I suppose it would make most sense to havestruse theslicecode in this case? But then there has also been talk about generalizingPatternto slices more broadly (in some limited cases?). So before doing a lot of tedious work, I'd like to work out what the best code sharing strategy is.Also, only some of the basic API functions are implemented right now. All the iterator variations can be added incrementally, looking at that all in one go (making sure that docs are all correct ect) was a bit too much for me, and probably for reviewers too. So that'll come later in smaller pieces.
some other general questions
ByteSearcherjust beSearchergiven its home module)?unstable?