commit | 60f909baf49688c70904c81462f9f3ab1183e79f | [log] [tgz] |
---|---|---|
author | Matthew Maurer <mmaurer@google.com> | Wed Jul 01 23:50:08 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Jul 01 23:50:08 2020 +0000 |
tree | b9d2947da83fa557df4710362416b453b66c8ae6 | |
parent | b0092e47845925e93818d1e24a906cbee49e897f [diff] | |
parent | 298e3f566e3950b87759a1b061abab6162ca0f39 [diff] |
Update to use flexible dependencies am: 40c490a237 am: f7aba79987 am: 132546ae6f am: f1860424d3 am: 298e3f566e Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/slab/+/1349495 Change-Id: I0e0a3a48ba3ef67ec6e819b34154dea0a84cea03
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.