commit | 132546ae6f69f6eb9d938aec8772aa1de8319314 | [log] [tgz] |
---|---|---|
author | Matthew Maurer <mmaurer@google.com> | Wed Jul 01 22:56:55 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Jul 01 22:56:55 2020 +0000 |
tree | b9d2947da83fa557df4710362416b453b66c8ae6 | |
parent | 312f4ad4b7933f52c6151d94685267f38c26498b [diff] | |
parent | f7aba79987aabb734c7d051b2b0a08cad5d4f127 [diff] |
Update to use flexible dependencies am: 40c490a237 am: f7aba79987 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/slab/+/1349495 Change-Id: I469b7eb36d4aee8f87fcefad7f4cb5fd2cd80310
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.