commit | d7ade33e6697488fe718009710a084bcd9b387ae | [log] [tgz] |
---|---|---|
author | Joel Galenson <jgalenson@google.com> | Tue Aug 24 18:23:54 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Aug 24 18:23:54 2021 +0000 |
tree | 93a966a35a7baf25c7751de48838d19b36dd7901 | |
parent | 76e39ba585c37fcb3043bb3183073c46ec127f96 [diff] | |
parent | 5b201ad53825b6f46b696dd35c96079c1ff3d702 [diff] |
Update TEST_MAPPING am: 5b201ad538 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/slab/+/1805600 Change-Id: Iaa2ebec457ae136e63003a7a414a032fd46d7775
Pre-allocated storage for a uniform data type.
To use slab
, first add this to your Cargo.toml
:
[dependencies] slab = "0.4"
Next, add this to your crate:
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.