minspan-0.1.1/.cargo_vcs_info.json 0000644 00000000112 00000000001 0012472 0 ustar {
"git": {
"sha1": "77c940dae19c601e62aa8b45c54868bc4b2153ee"
}
}
minspan-0.1.1/.gitignore 0000644 0000000 0000000 00000000023 00726746425 0013303 0 ustar 0000000 0000000 /target
Cargo.lock
minspan-0.1.1/Cargo.toml 0000644 00000001211 00000000001 0010471 0 ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.
[package]
edition = "2018"
name = "minspan"
version = "0.1.1"
description = "a package for determining the minimum span of one vector within another"
license = "MIT"
[dependencies]
minspan-0.1.1/Cargo.toml.orig 0000644 0000000 0000000 00000000430 00726746425 0014204 0 ustar 0000000 0000000 [package]
name = "minspan"
version = "0.1.1"
edition = "2018"
description = "a package for determining the minimum span of one vector within another"
license = "MIT"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
minspan-0.1.1/README.md 0000644 0000000 0000000 00000001045 00726746425 0012577 0 ustar 0000000 0000000 # 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.
minspan-0.1.1/src/lib.rs 0000644 0000000 0000000 00000005705 00726746425 0013232 0 ustar 0000000 0000000
// We want to make sure we are getting the shortest match possible
// without getting tripped up by pathological cases.
pub mod minspan {
pub fn span(query: &Vec, history : &Vec) -> Option<(usize,usize)>
where
A: PartialEq {
let mut starting_at : Vec