commit | 0b26018573c86ee01cb5d5bc99565fdde848cc67 | [log] [tgz] |
---|---|---|
author | Chih-Hung Hsieh <chh@google.com> | Thu Jun 18 00:09:37 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Jun 18 00:09:37 2020 +0000 |
tree | 927c3fff45b9c3166252ef7251178aa2a9d7a07d | |
parent | 93cd2bb2e2d8e297108b65fbb262c5bc3c070ac1 [diff] | |
parent | 54b0b4e3dadaa9b9d4983279952c82f2b4bd280d [diff] |
Separate host and device tests am: 0aa6809418 am: 2937fa587d am: 312f4ad4b7 am: 54b0b4e3da Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/slab/+/1337255 Change-Id: I678c01fa38d8abe7a85b5668da1e4cb1be935e50
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.