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

#437 in Algorithms

Download history 1057/week @ 2023-11-20 846/week @ 2023-11-27 856/week @ 2023-12-04 1437/week @ 2023-12-11 1220/week @ 2023-12-18 456/week @ 2023-12-25 934/week @ 2024-01-01 1507/week @ 2024-01-08 1530/week @ 2024-01-15 1243/week @ 2024-01-22 1680/week @ 2024-01-29 2157/week @ 2024-02-05 2991/week @ 2024-02-12 1368/week @ 2024-02-19 1925/week @ 2024-02-26 2089/week @ 2024-03-04

8,426 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

~170–345KB