Crates.io | abbrev |
lib.rs | abbrev |
version | 0.2.2 |
source | src |
created_at | 2018-01-31 04:46:07.28113 |
updated_at | 2020-01-01 13:30:43.040916 |
description | Like Ruby's Abbrev module |
homepage | |
repository | https://github.com/arniu/abbrev-rs |
max_upload_size | |
id | 48976 |
size | 7,624 |
Like Ruby's Abbrev module
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"
}