abbrev

Crates.ioabbrev
lib.rsabbrev
version0.2.2
sourcesrc
created_at2018-01-31 04:46:07.28113
updated_at2020-01-01 13:30:43.040916
descriptionLike Ruby's Abbrev module
homepage
repositoryhttps://github.com/arniu/abbrev-rs
max_upload_size
id48976
size7,624
Arniu Tseng (arniu)

documentation

README

abbrev

Build Status Crates.io

Like Ruby's Abbrev module

Example

use abbrev::abbrev;

fn main() {
    let xs = vec!["foo", "fool", "folding", "flop"];
    let map = abbrev(&xs);

    println!("{:#?}", map);
}

And it will print:

{
    "fl": "flop",
    "flo": "flop",
    "flop": "flop",
    "fol": "folding",
    "fold": "folding",
    "foldi": "folding",
    "foldin": "folding",
    "folding": "folding",
    "foo": "foo",
    "fool": "fool"
}

License

MIT

Commit count: 8

cargo fmt