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

#575 in Algorithms

Download history 1827/week @ 2025-01-05 1866/week @ 2025-01-12 1816/week @ 2025-01-19 1441/week @ 2025-01-26 1639/week @ 2025-02-02 1797/week @ 2025-02-09 1315/week @ 2025-02-16 1427/week @ 2025-02-23 1794/week @ 2025-03-02 1567/week @ 2025-03-09 2002/week @ 2025-03-16 1101/week @ 2025-03-23 1210/week @ 2025-03-30 1320/week @ 2025-04-06 2723/week @ 2025-04-13 4189/week @ 2025-04-20

9,489 downloads per month
Used in 33 crates (10 directly)

MIT/Apache

62KB
1K SLoC

Generalization of str::find to both str and [_], see SubsliceExt for docs.


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

Dependencies

~100–270KB