#within #another #spans #minimum #string #determine #vector

minspan

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

2 releases

0.1.1 Sep 3, 2021
0.1.0 Sep 3, 2021

#19 in #minimum

Download history 758/week @ 2024-01-10 623/week @ 2024-01-17 524/week @ 2024-01-24 428/week @ 2024-01-31 770/week @ 2024-02-07 544/week @ 2024-02-14 1249/week @ 2024-02-21 1547/week @ 2024-02-28 944/week @ 2024-03-06 698/week @ 2024-03-13 531/week @ 2024-03-20 598/week @ 2024-03-27 585/week @ 2024-04-03 912/week @ 2024-04-10 643/week @ 2024-04-17 474/week @ 2024-04-24

2,796 downloads per month
Used in 3 crates (via atuin-client)

MIT license

5KB
58 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