commit | b6740cb816412a17394eade0f9038e76c8091760 | [log] [tgz] |
---|---|---|
author | Chih-Hung Hsieh <chh@google.com> | Thu Aug 27 22:39:45 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Aug 27 22:39:45 2020 +0000 |
tree | e3129ac5572f7061604d6ff82c9a913386032802 | |
parent | 32ad70ff39e9a06d565deb0cc105b16e848e476c [diff] | |
parent | 90bc95f17cf3aea431247080a86233fd691dd803 [diff] |
Fix slab/METADATA am: a1ba6d8d77 am: 57bc79c307 am: 90bc95f17c Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/slab/+/1414005 Change-Id: I73cd8727496795f281e1c5fe392e538ea24dec11
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.