commit | a0e7b504254bcf4b0f4347de05a0831265b8ecfb | [log] [tgz] |
---|---|---|
author | Chih-Hung Hsieh <chh@google.com> | Mon Jul 20 15:51:02 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Mon Jul 20 15:51:02 2020 +0000 |
tree | ed3d22c3522b68e4a3b2ea12dca9f0fd1b56acdb | |
parent | 3de0010b70acadd0666f88302db4ad6ab4fe4ad7 [diff] | |
parent | 0a70ef71363106c62b406d0d14cac4aa12d39cda [diff] |
Share srcs in rust_defaults am: 5f8545e216 am: 9547a66d99 am: 0a70ef7136 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/slab/+/1366108 Change-Id: I53018445c036bb65ee7b89de70e352b056218c21
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.