commit | 05685ea734c287409e7bc6fd6d4954598d0fdf91 | [log] [tgz] |
---|---|---|
author | Andrew Walbran <qwandor@google.com> | Mon Jun 15 17:18:04 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Mon Jun 15 17:18:04 2020 +0000 |
tree | 24c395e8d37c85ca3edb894c0e2378941570a59a | |
parent | 42cb57b5ec98b5ed0bf260222ad7819acac3cac2 [diff] | |
parent | 47a199fdece279a72682d3ac7a68acc264f787fd [diff] |
Allow building for device. am: eb50abb497 am: 47a199fdec Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/slab/+/1333193 Change-Id: Ia1186dd5687afb36260809534700c3003784959c
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.