commit | 060614b8c7c5bb22228e8fe6cc89c3a977df37d8 | [log] [tgz] |
---|---|---|
author | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | Thu Jul 11 15:56:40 2024 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Jul 11 15:56:40 2024 +0000 |
tree | ad992311c8e188f2baa7ddd3bb7d0f5a87eba6b7 | |
parent | 17d9307c2258ffa1992c0e8c1ddeabe5496c60b7 [diff] | |
parent | 1339d2e99896ee16c46ba4a3e516b46772892a49 [diff] |
Merge "Mark apex-available" into main am: 1339d2e998 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/slab/+/3166177 Change-Id: I961298aacfeb461fd781dba566c499e4b30aa34d 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.