commit | d54dec1dcbf804b1c1fe04ed890f118dcd9e436f | [log] [tgz] |
---|---|---|
author | Joel Galenson <jgalenson@google.com> | Wed Jun 09 20:59:19 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Jun 09 20:59:19 2021 +0000 |
tree | 0dcab013f19a5df6b8d8fc42f5ec73b39ca3dc22 | |
parent | 7ff3771e08c8986974cba124dcccb529c8f78fc9 [diff] | |
parent | c1c74762dbe2044706e5f3e36154b93c12c9afba [diff] |
Upgrade rust/crates/slab to 0.4.3 am: c03c72f058 am: 2a4ca8c887 am: c1c74762db Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/slab/+/1713268 Change-Id: I7afc4349760e1ca004d7194b6478cd869faab81b
Pre-allocated storage for a uniform data type.
To use slab
, first add this to your Cargo.toml
:
[dependencies] slab = "0.4.3"
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.