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

#490 in Algorithms

Download history 2535/week @ 2024-06-17 2234/week @ 2024-06-24 1931/week @ 2024-07-01 1777/week @ 2024-07-08 2095/week @ 2024-07-15 2613/week @ 2024-07-22 2308/week @ 2024-07-29 2410/week @ 2024-08-05 2392/week @ 2024-08-12 2694/week @ 2024-08-19 3596/week @ 2024-08-26 3618/week @ 2024-09-02 1931/week @ 2024-09-09 2370/week @ 2024-09-16 3170/week @ 2024-09-23 2666/week @ 2024-09-30

10,310 downloads per month
Used in 30 crates (10 directly)

MIT/Apache

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>

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

~110–280KB