commit | ef64a94361ef57c7e3db342b8438649bf34ca260 | [log] [tgz] |
---|---|---|
author | Andrew Walbran <qwandor@google.com> | Wed Nov 15 17:13:24 2023 +0000 |
committer | Andrew Walbran <qwandor@google.com> | Wed Nov 15 17:13:24 2023 +0000 |
tree | e351dd4f83e1b4d4015bf825c853a871836e47dd | |
parent | b4d6ef52b3455146bc03e8291ce4859cc1ec8d42 [diff] |
Migrate to cargo_embargo. Bug: 293289578 Test: Ran cargo_embargo, compared Android.bp Change-Id: Ib7fc3a97de31b3775d9439fac57e062eb4762e93
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.