commit | fbd00d8676e2b5631bbfa8b32dbaa45f786f1f32 | [log] [tgz] |
---|---|---|
author | Xin Li <delphij@google.com> | Wed Nov 25 05:40:11 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Nov 25 05:40:11 2020 +0000 |
tree | f865d7a89806ca82f268b07460e74266336bf724 | |
parent | 4b1db7d4b7af93c1dc94826a562337ff9e4b1f04 [diff] | |
parent | d2e97e9f34573183ff4984592ec9811da29849b5 [diff] |
Mark ab/6881855 as merged am: aa1eb11756 am: d2e97e9f34 Original change: https://googleplex-android-review.googlesource.com/c/platform/external/rust/crates/slab/+/13112958 Change-Id: Ic063639e4895f7b2cb02e2cf6f262c36376926f2
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.