stringedits

Crates.iostringedits
lib.rsstringedits
version0.2.0
sourcesrc
created_at2019-02-21 00:02:31.246159
updated_at2019-02-22 22:43:24.699332
descriptionstringedits provides the Edit trait and associated iterators for small edits to strings.
homepage
repositoryhttps://gitlab.com/efronlicht/stringedits
max_upload_size
id116100
size20,608
Efron Licht (efronlicht)

documentation

README

stringedits

The stringedits package contains the Edit trait & associated iterators for simple edits of strings

This is primarially a library crate for the project spellcheck_toy

Usage

Add stringedits = "0.1.4" under [dependencies] in your Cargo.toml, then bring the Edit trait into scope.

use stringedits::Edit;
let replaces = "ab".replaces().collect::<Vec<String>>().join(" ");
let want = concat!(
    "ab bb cb db eb fb gb hb ib jb kb lb mb nb ob pb qb rb sb tb ub vb wb xb yb zb ", // replace first character, 'a'
    "aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az", // replace second character, 'b'
);
assert_eq!(want, replaces);

Author

Written by Efron Licht (efron.python@gmail.com)

License

Available under the MIT License

Commit count: 10

cargo fmt