commit | 818b7769d412ad67c30955c383aa24844dacbfdc | [log] [tgz] |
---|---|---|
author | Xin Li <delphij@google.com> | Sat Aug 14 06:57:11 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Sat Aug 14 06:57:11 2021 +0000 |
tree | d491e6133a10e7ac0f7aec3e5d2fe25cc87e92b7 | |
parent | a50483a56911ab7ade78b609364bfdc05af4e7b8 [diff] | |
parent | d78ba363fe21106c7616e908fb92789528137958 [diff] |
[automerger skipped] Mark sc-dev-plus-aosp-without-vendor@7634622 as merged am: 76e39ba585 -s ours am: 957e05e6e4 -s ours am: d78ba363fe -s ours am skip reason: Merged-In Ieca2d527db61e24c01f70b1a1133be0b6da139ed with SHA-1 31fb06ec29 is already in history Original change: https://googleplex-android-review.googlesource.com/c/platform/external/rust/crates/slab/+/15570660 Change-Id: If6919f61d1e8983330cdbff4a0a7e7e77710171a
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.