commit | 79bf655ee5c4542dce8a58fc9912fe0053d81725 | [log] [tgz] |
---|---|---|
author | Matthew Maurer <mmaurer@google.com> | Thu Mar 09 19:10:09 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Mar 09 19:10:09 2023 +0000 |
tree | 7f08bb33b7d46ae8a14a9f02449fada34d5375b2 | |
parent | 4a9c9baed3da773494c6d5356464a3315e8496a7 [diff] | |
parent | 37a9e1f4b134d9eff5c341099c2950ea7a5888b9 [diff] |
Merge "Make slab available to product and vendor" am: 61af609cca am: 64fcafb704 am: 37a29094c1 am: b4d6ef52b3 am: 37a9e1f4b1 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/slab/+/2475717 Change-Id: I55b1767c54e63b98590c551c2394aeacee5c4657 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
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.