commit | ab11d88588b13fb9fd937602cd0d8435dd1d28d0 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Wed Mar 08 15:44:43 2023 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Wed Mar 08 15:44:43 2023 +0000 |
tree | 34d25291686de73533cbd5577f62fa9c248dbc0d | |
parent | af08cce434e4716cedb7c4d55b0e5f5051d7ede4 [diff] | |
parent | cbeea3467f61cb921ff5e0e2c47fba5d9a8132a5 [diff] |
Snap for 9710098 from cbeea3467f61cb921ff5e0e2c47fba5d9a8132a5 to mainline-tzdata5-release Change-Id: I0123ff1b94554d38653b56e544ebfebae9fcd9f3
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.