commit | 202d85cc4f1e7bf05e0c9c5857f419a75e708c20 | [log] [tgz] |
---|---|---|
author | Joel Galenson <jgalenson@google.com> | Wed Jun 09 21:17:11 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Jun 09 21:17:11 2021 +0000 |
tree | 0dcab013f19a5df6b8d8fc42f5ec73b39ca3dc22 | |
parent | e150d913b5eaaa59e3e1fa87d2ec3d64de16f19b [diff] | |
parent | d54dec1dcbf804b1c1fe04ed890f118dcd9e436f [diff] |
Upgrade rust/crates/slab to 0.4.3 am: c03c72f058 am: 2a4ca8c887 am: c1c74762db am: d54dec1dcb Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/slab/+/1713268 Change-Id: I788c2d707b889330851370e682785fb6fc5f89a0
Pre-allocated storage for a uniform data type.
To use slab
, first add this to your Cargo.toml
:
[dependencies] slab = "0.4.3"
Next, add this to your crate:
extern crate slab; 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.