Commit Graph

25 Commits (master)

Author SHA1 Message Date
Daniel Prilik 6716339551 remove #[feature(alloc)], (stable since Rust 1.36) 2020-07-04 00:46:55 +00:00
Andreas Molzer 35864e38fa Add a slot map implementation
A slot map is a linear container similar to a vector but the indices
contain are invalidated when the element is removed, and can not (or are
very unlikely to) incidentally refer to a valid element again even if
new elements are inserted.

This implementation differs from allocating slot maps as it does not
prefer value semantics for inserting and removing elements but rather
offers a reserve and remove interface based on mutable references. This
makes it easier for a user to avoid dropping any instances as any
initialization and de-initialization can be freely chosen to write or
swap. This is important if instances may contain costly resources such
as allocations that are hard to recover.
2020-01-25 09:54:07 +00:00
Marc-Andre Lureau 29066a94f8 Do not constrain Owned variants to 'static lifetime.
This unnecessarily restricts the contents of the container to have
a 'static lifetime, even if otherwise there is no such requirement.
2019-04-24 13:00:53 +00:00
whitequark 7d917b271c Update to track changes in liballoc. 2018-07-11 01:00:22 +00:00
whitequark c10a57bf91 Remove #![feature(collections_range)], as it is stable since Rust 1.28.
(Rust 1.28 is not yet released.)

Also, rename methods to reflect changes made during stabilization.
2018-05-31 18:03:46 +00:00
Valentin Lorentz 69c1a40aa9 impl DoubleEndedIterator for ManagedMapRange. 2018-05-26 04:20:33 +00:00
whitequark 3d55592b98 Remove #![feature(slice_rotate)], as it is stable since Rust 1.26. 2018-05-24 21:39:09 +00:00
whitequark 1328e59fc7 Minor stylistic fixes. 2018-05-24 21:18:14 +00:00
Valentin Lorentz 4299b43859 Add ManagedMap::range. 2018-05-24 21:15:59 +00:00
Valentin Lorentz cea6d52b0c Add tests for ManagedMap::get. 2018-05-17 07:27:47 +00:00
Peter Hall d9c4f784d4 Fixed typo 2018-04-05 15:18:27 +00:00
Astro 0192eb98d8 Implement ManagedMap::iter_mut(). 2018-03-24 03:21:46 +00:00
Astro ecbc2ee8e5 Catch insert() on ManagedMap with zero-sized backing store 2018-03-10 14:17:07 +00:00
Astro 660378c0bc Implement .is_empty(), .len(), .iter() for ManagedMap. 2018-03-06 05:26:29 +00:00
whitequark 5111131e61 Update for rustc 1.25 nightly. 2018-01-12 23:03:39 +00:00
whitequark 9e0d5855f0 Add tests for ManagedMap::Borrowed and fix some bugs. 2017-11-19 09:40:23 +00:00
whitequark 6ba2f4d0fb Add an experimental ManagedMap container. 2017-11-10 03:22:23 +00:00
Philipp Oppermann 9db51c3194 The collections crate was merged into the alloc crate 2017-09-08 08:38:46 +00:00
whitequark 2f11058e7d Remove the `use_` prefix from feature names.
I haven't realized that a feature `log` with an optional crate
dependency `log` activates that dependency, and added the prefix
to avoid a "clash". This is unnecessary.
2017-03-05 05:43:12 +00:00
whitequark f6a0304a06 Add an impl From<[_; 0]> for ManagedSlice. 2017-01-11 01:17:57 +00:00
whitequark e62a985deb Add conversions from unboxed slices. 2017-01-10 11:29:18 +00:00
whitequark 7a882dd581 Fix some documentation issues. 2017-01-07 18:49:53 +00:00
whitequark f32ddb6286 Fix build with use_alloc+use_std. 2017-01-07 18:42:46 +00:00
whitequark b1e24a9826 Implement. 2017-01-07 18:35:32 +00:00
whitequark a816d0d4c2 Initial commit. 2016-12-17 09:49:25 +00:00