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

#188 in Algorithms

Download history 46/week @ 2021-08-09 48/week @ 2021-08-16 51/week @ 2021-08-23 29/week @ 2021-08-30 38/week @ 2021-09-06 49/week @ 2021-09-13 37/week @ 2021-09-20 51/week @ 2021-09-27 36/week @ 2021-10-04 47/week @ 2021-10-11 77/week @ 2021-10-18 231/week @ 2021-10-25 328/week @ 2021-11-01 145/week @ 2021-11-08 158/week @ 2021-11-15 234/week @ 2021-11-22

135 downloads per month
Used in 7 crates (6 directly)

MIT/Apache

60KB
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>

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

~225KB

}`