commit | f1860424d39b4de51c6f3a279b4dfd82a08944f5 | [log] [tgz] |
---|---|---|
author | Matthew Maurer <mmaurer@google.com> | Wed Jul 01 23:11:26 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Jul 01 23:11:26 2020 +0000 |
tree | b9d2947da83fa557df4710362416b453b66c8ae6 | |
parent | 54b0b4e3dadaa9b9d4983279952c82f2b4bd280d [diff] | |
parent | 132546ae6f69f6eb9d938aec8772aa1de8319314 [diff] |
Update to use flexible dependencies am: 40c490a237 am: f7aba79987 am: 132546ae6f Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/slab/+/1349495 Change-Id: Ia64502848e0a9160c877137e207318d681874a91
Pre-allocated storage for a uniform data type.
To use slab
, first add this to your Cargo.toml
:
[dependencies] slab = "0.4.2"
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.