Crates.io | smap |
lib.rs | smap |
version | 0.3.0 |
source | src |
created_at | 2020-07-14 01:03:55.816032 |
updated_at | 2020-07-14 03:00:23.112565 |
description | Simple-Map: HashMap for easy to use. |
homepage | |
repository | https://github.com/cccrust/smap/ |
max_upload_size | |
id | 264880 |
size | 5,860 |
use smap::Dict;
fn main() {
let mut e2c = Dict::new();
e2c.add("a", "一隻");
e2c.add("dog", "狗");
e2c.add("cat", "貓");
e2c.add("chase", "追");
e2c.add("bite", "咬");
println!("{:?}", e2c.get("cat"));
println!("{:?}", e2c.get("xxx"));
assert!(e2c.get("cat") != None);
assert!(e2c.get("xxx") == None);
}
run:
$ cargo run
Compiling smap1 v0.1.0 (D:\ccc\ccc109a\se\rust\se\use\smap1)
Finished dev [unoptimized + debuginfo] target(s) in 2.91s
Running `target\debug\smap1.exe`
Some("貓")
None