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