commit | 6cd5ea6d76765a2f5c64bb202db7b8fdcd61b1b5 | [log] [tgz] |
---|---|---|
author | Treehugger Robot <treehugger-gerrit@google.com> | Wed Jun 15 22:28:24 2022 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Jun 15 22:28:24 2022 +0000 |
tree | 619b140d4e933acdbc6d87f524856c1a682011ad | |
parent | 812f7eaf50beabc2e6fe938c0aea66f10ff7fea5 [diff] | |
parent | 9c8040e47f29bf83babf197458632e74b0c3375b [diff] |
Merge "Update TEST_MAPPING" am: 5d58760a0a am: 3d49a1426a am: 3c703c342d am: 9c8040e47f Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/slab/+/2123297 Change-Id: Ibf333146e729a9353b012a950a23f28b7cf58f4f 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.