5 releases
Uses old Rust 2015
0.2.3 | Jul 12, 2021 |
---|---|
0.2.2 | Jan 25, 2019 |
0.2.1 | Jan 22, 2019 |
0.2.0 | Jul 23, 2018 |
0.1.0 | Jul 23, 2018 |
#423 in Algorithms
9,439 downloads per month
Used in 30 crates
(10 directly)
62KB
1K
SLoC
Documentation
Fast substring search for strings and byte strings, using the two-way algorithm.
This is the same code as is included in Rust's libstd to “power” str::find(&str), but here it is exposed with some improvements:
- subslice::SubsliceExt::find(&self, other: &Self) -> Option<usize>
- subslice::SubsliceExt::rfind(&self, other: &Self) -> Option<usize>
Interesting Links
- Two Way: http://www-igm.univ-mlv.fr/~lecroq/string/node26.html
- Matters Computational: http://www.jjj.de/fxt/#fxtbook
Notes
Consider denying 0/n factorizations, see http://lists.gnu.org/archive/html/bug-gnulib/2010-06/msg00184.html
lib.rs
:
Generalization of str::find
to both str
and [_]
, see SubsliceExt
for docs.
Dependencies
~170–340KB