commit | 312f4ad4b7933f52c6151d94685267f38c26498b | [log] [tgz] |
---|---|---|
author | Chih-Hung Hsieh <chh@google.com> | Wed Jun 17 23:34:26 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Jun 17 23:34:26 2020 +0000 |
tree | 927c3fff45b9c3166252ef7251178aa2a9d7a07d | |
parent | 05685ea734c287409e7bc6fd6d4954598d0fdf91 [diff] | |
parent | 2937fa587dbf9c00f160f52db313f71cbd4bd706 [diff] |
Separate host and device tests am: 0aa6809418 am: 2937fa587d Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/slab/+/1337255 Change-Id: I5f8ae1148635ef182b3c1795b937e8316f9aeaa1
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.