about summary refs log tree commit diff
path: root/src/libstd/collections/hash/set.rs
AgeCommit message (Collapse)AuthorLines
2014-12-16Small cleanups in HashMap based off of new rust features.Clark Gaebel-1/+1
2014-12-15std: Second pass stabilization of `default`Alex Crichton-0/+2
This commit performs a second pass stabilization of the `std::default` module. The module was already marked `#[stable]`, and the inheritance of `#[stable]` was removed since this attribute was applied. This commit adds the `#[stable]` attribute to the trait definition and one method name, along with all implementations found in the standard distribution.
2014-12-15Use wrapper structs for `HashSet`'s iterators.Chase Southwood-20/+59
Using a type alias for iterator implementations is fragile since this exposes the implementation to users of the iterator, and any changes could break existing code. This commit changes the iterators of `HashSet` to use proper new types, rather than type aliases. However, since it is fair-game to treat a type-alias as the aliased type, this is a: [breaking-change].
2014-12-15Use wrapper structs for `HashMap`'s iterators.Chase Southwood-3/+2
Using a type alias for iterator implementations is fragile since this exposes the implementation to users of the iterator, and any changes could break existing code. This commit changes the keys and values iterators of `HashMap` to use proper new types, rather than type aliases. However, since it is fair-game to treat a type-alias as the aliased type, this is a: [breaking-change].
2014-12-14std: Collapse SlicePrelude traitsAlex Crichton-1/+1
This commit collapses the various prelude traits for slices into just one trait: * SlicePrelude/SliceAllocPrelude => SliceExt * CloneSlicePrelude/CloneSliceAllocPrelude => CloneSliceExt * OrdSlicePrelude/OrdSliceAllocPrelude => OrdSliceExt * PartialEqSlicePrelude => PartialEqSliceExt
2014-12-13libstd: fix falloutJorge Aparicio-14/+22
2014-12-13libstd: fix falloutJorge Aparicio-4/+5
2014-12-08auto merge of #19378 : japaric/rust/no-as-slice, r=alexcrichtonbors-3/+3
Now that we have an overloaded comparison (`==`) operator, and that `Vec`/`String` deref to `[T]`/`str` on method calls, many `as_slice()`/`as_mut_slice()`/`to_string()` calls have become redundant. This patch removes them. These were the most common patterns: - `assert_eq(test_output.as_slice(), "ground truth")` -> `assert_eq(test_output, "ground truth")` - `assert_eq(test_output, "ground truth".to_string())` -> `assert_eq(test_output, "ground truth")` - `vec.as_mut_slice().sort()` -> `vec.sort()` - `vec.as_slice().slice(from, to)` -> `vec.slice(from_to)` --- Note that e.g. `a_string.push_str(b_string.as_slice())` has been left untouched in this PR, since we first need to settle down whether we want to favor the `&*b_string` or the `b_string[]` notation. This is rebased on top of #19167 cc @alexcrichton @aturon
2014-12-06libstd: remove unnecessary `to_string()` callsJorge Aparicio-2/+2
2014-12-06libstd: remove unnecessary `as_slice()` callsJorge Aparicio-1/+1
2014-12-05Utilize fewer reexportsCorey Farwell-2/+2
In regards to: https://github.com/rust-lang/rust/issues/19253#issuecomment-64836729 This commit: * Changes the #deriving code so that it generates code that utilizes fewer reexports (in particur Option::* and Result::*), which is necessary to remove those reexports in the future * Changes other areas of the codebase so that fewer reexports are utilized
2014-11-30std: Remove implicit shrinking from hash_map.Piotr Czarnecki-4/+46
Implements fn shrink_to_fit for HashMap.
2014-11-25Fallout from stabilizationAaron Turon-3/+3
2014-11-17libstd: Deprecate _equiv methodsAaron Turon-43/+22
This commit deprecates the `_equiv` family of methods on `HashMap` and `HashSet` by instead generalizing the "normal" methods like `get` and `remove` to use the new `std::borrow` infrastructure. [breaking-change]
2014-11-08Renamed Extendable to Extendgamazeps-2/+2
In order to upgrade, simply rename the Extendable trait to Extend in your code Part of #18424 [breaking-change]
2014-11-06rollup merge of #18605 : Gankro/collect-fruitAlex Crichton-8/+22
2014-11-06Implement low-hanging fruit of collection conventionsAlexis Beingessner-8/+22
* Renames/deprecates the simplest and most obvious methods * Adds FIXME(conventions)s for outstanding work * Marks "handled" methods as unstable NOTE: the semantics of reserve and reserve_exact have changed! Other methods have had their semantics changed as well, but in a way that should obviously not typecheck if used incorrectly. Lots of work and breakage to come, but this handles most of the core APIs and most eggregious breakage. Future changes should *mostly* focus on niche collections, APIs, or simply back-compat additions. [breaking-change]
2014-11-06Prelude: rename and consolidate extension traitsAaron Turon-1/+1
This commit renames a number of extension traits for slices and string slices, now that they have been refactored for DST. In many cases, multiple extension traits could now be consolidated. Further consolidation will be possible with generalized where clauses. The renamings are consistent with the [new `-Prelude` suffix](https://github.com/rust-lang/rfcs/pull/344). There are probably a few more candidates for being renamed this way, but that is left for API stabilization of the relevant modules. Because this renames traits, it is a: [breaking-change] However, I do not expect any code that currently uses the standard library to actually break. Closes #17917
2014-11-05Add impls of the comparison operators for fixed-length arrays of lengths ↵Niko Matsakis-1/+1
0...32 and repair various cases where slices and fixed-length arrays were being compared.
2014-11-03std: Fix fallout of changing `#[deriving(Clone)]`Jorge Aparicio-1/+0
2014-11-02refactor libcollections as part of collection reformAlexis Beingessner-0/+834
* Moves multi-collection files into their own directory, and splits them into seperate files * Changes exports so that each collection has its own module * Adds underscores to public modules and filenames to match standard naming conventions (that is, treemap::{TreeMap, TreeSet} => tree_map::TreeMap, tree_set::TreeSet) * Renames PriorityQueue to BinaryHeap * Renames SmallIntMap to VecMap * Miscellanious fallout fixes [breaking-change]