#spans #string #bounds #minimum #find #haystack #matches

minspan

a package for determining the minimum span of one vector within another

3 releases

0.1.2 Jul 29, 2024
0.1.1 Sep 3, 2021
0.1.0 Sep 3, 2021

#297 in Text processing

Download history 391/week @ 2024-08-14 384/week @ 2024-08-21 414/week @ 2024-08-28 557/week @ 2024-09-04 460/week @ 2024-09-11 381/week @ 2024-09-18 431/week @ 2024-09-25 508/week @ 2024-10-02 413/week @ 2024-10-09 382/week @ 2024-10-16 321/week @ 2024-10-23 290/week @ 2024-10-30 365/week @ 2024-11-06 390/week @ 2024-11-13 456/week @ 2024-11-20 464/week @ 2024-11-27

1,729 downloads per month
Used in 5 crates (via atuin-client)

MIT license

5KB
62 lines

minspan

This is a tiny crate to find the minimal bounds of a string within another one. The needle must be found in its entirety within the haystack, but there may be any number of intervening characters that are just chaff. This is useful for applications like fuzzy-completers, where a shorter match is generally preferable ("curl" matches "curl https://rust-lang.org" better than it matches "colossally urban lapidarians").

The interface is small but under flux, it's possible that a slice is a better return value than bare integer indices.

No runtime deps