commit | 989359447f306f876e07f5af72ad05c82012f6d7 | [log] [tgz] |
---|---|---|
author | Chih-Hung Hsieh <chh@google.com> | Thu Oct 01 20:01:41 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Oct 01 20:01:41 2020 +0000 |
tree | 240be64efbb507b98c26e89064057bd4d06ca213 | |
parent | 90bc95f17cf3aea431247080a86233fd691dd803 [diff] | |
parent | f01fb857457cd70e125b502336870625aa67298a [diff] |
Fill back missing upstream published files. am: 1c92141020 am: f01fb85745 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/slab/+/1443598 Change-Id: If0e5588ace13ff8454afeddae3d8011ec8d00875
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.