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

#933 in Algorithms

Download history 2872/week @ 2024-10-02 2537/week @ 2024-10-09 3209/week @ 2024-10-16 2989/week @ 2024-10-23 2598/week @ 2024-10-30 2399/week @ 2024-11-06 3034/week @ 2024-11-13 3094/week @ 2024-11-20 2581/week @ 2024-11-27 2024/week @ 2024-12-04 2967/week @ 2024-12-11 2355/week @ 2024-12-18 374/week @ 2024-12-25 1453/week @ 2025-01-01 1700/week @ 2025-01-08 2015/week @ 2025-01-15

5,633 downloads per month
Used in 33 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

~105–275KB