commit | 4a07afab395e6fa7515c3519440c66207799c322 | [log] [tgz] |
---|---|---|
author | Chih-Hung Hsieh <chh@google.com> | Thu May 07 14:46:02 2020 -0700 |
committer | Chih-Hung Hsieh <chh@google.com> | Thu May 07 16:03:02 2020 -0700 |
tree | 8d8fc468a6d5cc67e70f968c9cd2080310f13c7f | |
parent | 467e34c698f25cd8a596ca3f894d0ec0dcf84452 [diff] |
Add rust_test modules and TEST_MAPPING * Two 'slab' tests in src and tests directory cannot be merged. So they have different module names. Bug: 156009151 Test: atest --host --rebuild-module-info -c --include-subdirs external/rust/crates Change-Id: I988a4129d9ed1ff627d98ce6dba990fbdd549262
Pre-allocated storage for a uniform data type.
To use slab
, first add this to your Cargo.toml
:
[dependencies] slab = "0.4.2"
Next, add this to your crate:
extern crate slab; use slab::Slab; let mut slab = Slab::new(); let hello = slab.insert("hello"); let world = slab.insert("world"); assert_eq!(slab[hello], "hello"); assert_eq!(slab[world], "world"); slab[world] = "earth"; assert_eq!(slab[world], "earth");
See documentation for more details.
This project is licensed under the MIT license.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in slab
by you, shall be licensed as MIT, without any additional terms or conditions.