summary refs log tree commit diff
path: root/src/libcollections/vec_map.rs
AgeCommit message (Collapse)AuthorLines
2015-07-30Auto merge of #26734 - Gankro:deprecate-vecmap, r=alexcrichtonbors-2/+5
VecMap doesn't really fit with the current standard library's strategy (small!). I've mirrored the code to https://github.com/contain-rs/vec-map but @GBGamer has already claimed the name on crates.io a couple months ago for the same purpose. It hasn't been updated since, though. CC @rust-lang/libs
2015-07-29deprecate vecmapAlexis Beingessner-2/+5
2015-07-27Show appropriate feature flags in docsSteve Klabnik-21/+42
2015-06-17std: Stabilize vec_map::Entry::or_insert{,_with}Alex Crichton-8/+7
These functions mirror the other Entry APIs of other maps, and were mistakenly just not stabilized the first time around.
2015-06-17Fallout in tests and docs from feature renamingsAlex Crichton-21/+21
2015-06-17collections: Split the `collections` featureAlex Crichton-9/+11
This commit also deprecates the `as_string` and `as_slice` free functions in the `string` and `vec` modules.
2015-06-10Removed many pointless calls to *iter() and iter_mut()Joshua Landau-2/+2
2015-06-08Implement RFC 839Johannes Oertel-0/+7
Closes #25976.
2015-05-11Minor optimization for `VecMap::split_off`Johannes Oertel-1/+1
We don't need to copy any elements if `at` is behind the last element in the map. The last element is at index `self.v.len() - 1`, so we should not copy if `at` is greater or equals `self.v.len()`.
2015-04-28collections: Implement vec::drain(range) according to RFC 574Ulrik Sverdrup-1/+1
Old `.drain()` on vec is performed using `.drain(..)` now. `.drain(range)` is unstable and under feature(collections_drain) [breaking-change]
2015-04-21rollup merge of #24541: alexcrichton/issue-24538Alex Crichton-32/+26
This is an implementation of [RFC 1030][rfc] which adds these traits to the prelude and additionally removes all inherent `into_iter` methods on collections in favor of the trait implementation (which is now accessible by default). [rfc]: https://github.com/rust-lang/rfcs/pull/1030 This is technically a breaking change due to the prelude additions and removal of inherent methods, but it is expected that essentially no code breaks in practice. [breaking-change] Closes #24538
2015-04-18Utilize if..let for get_mut doc-comment examplesCorey Farwell-6/+4
2015-04-17std: Add Default/IntoIterator/ToOwned to the preludeAlex Crichton-32/+26
This is an implementation of [RFC 1030][rfc] which adds these traits to the prelude and additionally removes all inherent `into_iter` methods on collections in favor of the trait implementation (which is now accessible by default). [rfc]: https://github.com/rust-lang/rfcs/pull/1030 This is technically a breaking change due to the prelude additions and removal of inherent methods, but it is expected that essentially no code breaks in practice. [breaking-change] Closes #24538
2015-04-13pluralize doc comment verbs and add missing periodsAndrew Paseltiner-2/+2
2015-04-10Fix some typosTibor Benke-1/+1
Signed-off-by: Tibor Benke <ihrwein@gmail.com>
2015-03-27rollup merge of #23738: alexcrichton/snapshotsAlex Crichton-23/+0
Conflicts: src/libcollections/vec.rs
2015-03-27default => or_insert per RFCAlexis Beingessner-4/+4
2015-03-26update everything to use Entry defaultsAlexis-11/+2
2015-03-26entry API v3: replace Entry::get with Entry::default and Entry::default_withAlexis-0/+24
2015-03-26Register new snapshotsAlex Crichton-23/+0
2015-03-23rollup merge of #23598: brson/gateAlex Crichton-0/+21
Conflicts: src/compiletest/compiletest.rs src/libcollections/lib.rs src/librustc_back/lib.rs src/libserialize/lib.rs src/libstd/lib.rs src/libtest/lib.rs src/test/run-make/rustdoc-default-impl/foo.rs src/test/run-pass/env-home-dir.rs
2015-03-23rollup merge of #23648: steveklabnik/rollupAlex Crichton-7/+9
- Successful merges: #22954, #23119, #23509, #23561, #23590, #23607, #23608, #23618, #23622, #23639, #23641 - Failed merges: #23401
2015-03-23Add #![feature] attributes to doctestsBrian Anderson-0/+21
2015-03-23Adjust Index/IndexMut impls. For generic collections, we takeNiko Matsakis-1/+41
references. For collections whose keys are integers, we take both references and by-value.
2015-03-18Stabilize Entry typesAaron Turon-7/+9
This commit marks as `#[stable]` the `Entry` types for the maps provided by `std`. The main reason these had been left unstable previously was uncertainty about an eventual trait design, but several plausible designs have been proposed that all work fine with the current type definitions.
2015-03-16extract libcollections tests into libcollectionstestJorge Aparicio-507/+0
2015-03-09Rename #[should_fail] to #[should_panic]Steven Fackler-1/+1
2015-03-03Add `: Box<_>` or `::Box<_>` type annotations to various places.Felix S. Klock II-1/+1
This is the kind of change that one is expected to need to make to accommodate overloaded-`box`. ---- Note that this is not *all* of the changes necessary to accommodate Issue 22181. It is merely the subset of those cases where there was already a let-binding in place that made it easy to add the necesasry type ascription. (For unnamed intermediate `Box` values, one must go down a different route; `Box::new` is the option that maximizes portability, but has potential inefficiency depending on whether the call is inlined.) ---- There is one place worth note, `run-pass/coerce-match.rs`, where I used an ugly form of `Box<_>` type ascription where I would have preferred to use `Box::new` to accommodate overloaded-`box`. I deliberately did not use `Box::new` here, because that is already done in coerce-match-calls.rs. ---- Precursor for overloaded-`box` and placement-`in`; see Issue 22181.
2015-02-25Rollup merge of #22157 - tbu-:pr_debug_collections, r=alexcrichtonManish Goregaokar-3/+3
r? @Gankro
2015-02-24Modify collection's `Debug` output to resemble in their content onlyTobias Bucher-3/+3
2015-02-24Use arrays instead of vectors in testsVadim Petrochenkov-3/+3
2015-02-23Rollup merge of #22494 - msiemens:vec_map-append-split_off, r=GankroManish Goregaokar-2/+170
2015-02-22Implement append and split_off for VecMap (RFC 509)Markus Siemens-2/+170
Implements `append()` and `split_off()` for `VecMap`. It's worth noting that `append()` will overwrite existing keys (the RFC doesn't specify how `append()` should handle duplicate keys). cc #19986
2015-02-20Register new snapshotsAlex Crichton-15/+0
2015-02-18rollup merge of #22286: nikomatsakis/variance-4bAlex Crichton-1/+1
Conflicts: src/librustc/middle/infer/combine.rs src/librustc_typeck/check/wf.rs
2015-02-18rollup merge of #22491: Gankro/into_iterAlex Crichton-2/+2
Conflicts: src/libcollections/bit.rs src/libcollections/linked_list.rs src/libcollections/vec_deque.rs src/libstd/sys/common/wtf8.rs
2015-02-18make FromIterator use IntoIteratorAlexis-1/+1
This breaks all implementors of FromIterator, as they must now accept IntoIterator instead of Iterator. The fix for this is generally trivial (change the bound, and maybe call into_iter() on the argument to get the old argument). Users of FromIterator should be unaffected because Iterators are IntoIterator. [breaking-change]
2015-02-18make Extend use IntoIteratorAlexis-1/+1
This breaks all implementors of Extend, as they must now accept IntoIterator instead of Iterator. The fix for this is generally trivial (change the bound, and maybe call into_iter() on the argument to get the old argument). Users of Extend should be unaffected because Iterators are IntoIterator. [breaking-change]
2015-02-18std: Stabilize the `hash` moduleAlex Crichton-1/+18
This commit is an implementation of [RFC 823][rfc] which is another pass over the `std::hash` module for stabilization. The contents of the module were not entirely marked stable, but some portions which remained quite similar to the previous incarnation are now marked `#[stable]`. Specifically: [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0823-hash-simplification.md * `std::hash` is now stable (the name) * `Hash` is now stable * `Hash::hash` is now stable * `Hasher` is now stable * `SipHasher` is now stable * `SipHasher::new` and `new_with_keys` are now stable * `Hasher for SipHasher` is now stable * Many `Hash` implementations are now stable All other portions of the `hash` module remain `#[unstable]` as they are less commonly used and were recently redesigned. This commit is a breaking change due to the modifications to the `std::hash` API and more details can be found on the [RFC][rfc]. Closes #22467 [breaking-change]
2015-02-18Fallout: Port Vec to use `Unique`Niko Matsakis-1/+1
2015-02-17Register new snapshotsAlex Crichton-33/+0
2015-02-17std: Stabilize the IntoIterator traitAlex Crichton-0/+3
Now that the necessary associated types exist for the `IntoIterator` trait this commit stabilizes the trait as-is as well as all existing implementations.
2015-02-13add an associated `Item` type to `IntoIterator`Jorge Aparicio-0/+36
2015-02-11rollup merge of #22151: Gankro/macro-benchAlex Crichton-65/+8
r? @alexcrichton
2015-02-10fix and macro-ify map benches, fixes #22134Alexis-65/+8
2015-02-09std: Rename IntoIterator::Iter to IntoIterAlex Crichton-3/+3
This is in preparation for stabilization of the `IntoIterator` trait. All implementations and references to `Iter` need to be renamed to `IntoIter`. [breaking-change]
2015-02-06make `IndexMut` a super trait over `Index`Jorge Aparicio-2/+0
closes #21630
2015-02-06libcollections: unit test fixesManish Goregaokar-1/+2
2015-02-06remove int_uint feature from libcollectionsAlexis-2/+2
2015-02-06Rollup merge of #21969 - Gankro:collections-cleanup, r=alexcrichtonManish Goregaokar-79/+77
This is 99% burning ints to the ground, but I also got rid of useless annotations or made code more \"idiomatic\" as I went along. Mostly changes in tests.