commit | 3309edccc3675969720efdd9b8f15e7a86e8c918 | [log] [tgz] |
---|---|---|
author | Joel Galenson <jgalenson@google.com> | Thu Aug 12 21:01:24 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Aug 12 21:01:24 2021 +0000 |
tree | d491e6133a10e7ac0f7aec3e5d2fe25cc87e92b7 | |
parent | 31fb06ec299af051eb2e5e7af53eaeac6932aee2 [diff] | |
parent | 48091efd682edfb00ce65c3f6d0bcdbf8947a27a [diff] |
Upgrade rust/crates/slab to 0.4.4 am: bf78b2784b am: 48091efd68 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/slab/+/1791008 Change-Id: I062d701b2b89928086d53e89ea6c2ca17acbe01e
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.