about summary refs log tree commit diff
path: root/src/libstd/hashmap.rs
AgeCommit message (Collapse)AuthorLines
2013-08-01std: Remove the internal iterator methods from trait Setblake2-ppc-22/+0
.intersection(), .union() etc methods in trait std::container::Set use internal iters. Remove these methods from the trait. I reported issue #8154 for the reinstatement of iterator-based set algebra methods to the Set trait. For bitv and treemap, that lack Iterator implementations of set operations, preserve them as methods directly on the types themselves. For HashSet, these methods are replaced by the present .union_iter() etc.
2013-08-01std: Replace `for` with `do { .. }` expr where internal iterators are usedblake2-ppc-19/+16
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-17/+18
2013-07-30std: Implement Extendable for hashmap, str and trieblake2-ppc-9/+17
2013-07-29std: Rename Iterator adaptor types to drop the -Iterator suffixblake2-ppc-3/+3
Drop the "Iterator" suffix for the the structs in std::iterator. Filter, Zip, Chain etc. are shorter type names for when iterator pipelines need their types written out in full in return value types, so it's easier to read and write. the iterator module already forms enough namespace.
2013-07-28Refactored vec and str iterators to remove prefixesjmgrosen-2/+2
2013-07-27auto merge of #8074 : thestinger/rust/iterator, r=cmrbors-2/+2
d7c9bb4 r=alexcrichton 7ae17e0 r=huonw
2013-07-27Remove dummy type parameters from iterator adaptorsblake2-ppc-2/+2
With the recent fixes to method resolution, we can now remove the dummy type parameters used as crutches in the iterator module. For example, the zip adaptor type is just ZipIterator<T, U> now.
2013-07-25Added default impls for container methodsSteven Fackler-19/+0
A couple of implementations of Container::is_empty weren't exactly self.len() == 0 so I left them alone (e.g. Treemap).
2013-07-21Minor cleanup of hashmapSteven Stewart-Gallus-11/+5
2013-07-20std: Implement Clone for VecIterator and iterators using itblake2-ppc-0/+2
The theory is simple, the immutable iterators simply hold state variables (indicies or pointers) into frozen containers. We can freely clone these iterators, just like we can clone borrowed pointers. VecIterator needs a manual impl to handle the lifetime struct member.
2013-07-20Use Option .take() or .take_unwrap() instead of util::replace where possibleblake2-ppc-2/+2
2013-07-18auto merge of #7857 : blake2-ppc/rust/fix-test-warnings, r=alexcrichtonbors-2/+2
Fix warnings that only show up when compiling the tests for libstd, libextra and one in librusti. Only trivial changes.
2013-07-18hashmap: Remove .consume() has rename .consume_iter() to .consume()blake2-ppc-64/+20
Updated all users of HashMap, HashSet old .consume() to use .consume() with a for loop. Since .consume() takes the map or set by value, it needs awkward extra code to in librusti's use of @mut HashMap, where the map value can not be directly moved out.
2013-07-18Fix warnings in libstd and librusti testsblake2-ppc-2/+2
2013-07-17librustc: Remove all uses of "copy".Patrick Walton-6/+15
2013-07-16hashmap: Iterators for hashset diff, sym. diff, intersec, unionblake2-ppc-10/+70
Implement the difference, union, etc iterators with the help of a custom iterator combinator with explicit closure environment. Reported issue #7814 to be able to use the std::iterator filter combinator.
2013-07-16hashmap: Remove .mutate_values() which is replaced by .mut_iter()blake2-ppc-13/+0
2013-07-15std: add consuming iterators for `HashMap` and `HashSet`Andrew Paseltiner-0/+82
2013-07-14auto merge of #7788 : MarkJr94/rust/from_iter, r=cmrbors-1/+49
Added Iterators for HashMap/Set, TreeMap/Set, TrieMap/Set, and PriorityQueue as per Issue #7626
2013-07-14Stripped trailing spaces; Implemented FromIterator for TreeMap and PriorityQueue=Mark Sinclair-4/+4
2013-07-14Implemented FromIterator for TrieMap and TrieSet=Mark Sinclair-0/+25
2013-07-14Implemented FromIterator for std::hashmap=Mark Sinclair-1/+24
2013-07-13Split mutable methods out of Set and MapSteven Fackler-9/+13
Fixes most of #4989. I didn't add Persistent{Set,Map} since the only persistent data structure is fun_treemap and its functionality is currently too limited to build a trait out of.
2013-07-08 Replaces the free-standing functions in f32, &c.Jens Nockert-1/+2
The free-standing functions in f32, f64, i8, i16, i32, i64, u8, u16, u32, u64, float, int, and uint are replaced with generic functions in num instead. If you were previously using any of those functions, just replace them with the corresponding function with the same name in num. Note: If you were using a function that corresponds to an operator, use the operator instead.
2013-07-04Implement consuming iterators for ~[], remove vec::{consume, ↵Huon Wilson-3/+4
consume_reverse, map_consume}.
2013-06-30Convert vec::{rposition, rposition_elem, position_elem, contains} to methods.Huon Wilson-5/+5
2013-06-29Removing a lot of usage of '&const'Alex Crichton-4/+4
2013-06-29'Borrow' stack closures rather than copying them (e.g., "|x|f(x)"), in prep ↵Ben Blum-2/+3
for making them noncopyable.
2013-06-25remove `each` from vec, HashMap and HashSetDaniel Micay-11/+0
2013-06-25container: remove internal iterators from MapDaniel Micay-28/+28
the maps are being migrated to external iterators
2013-06-23hashmap: add FIXME numberDaniel Micay-1/+1
2013-06-23std::hashmap: Remove BaseIter impl for HashSetblake2-ppc-7/+6
Remove the BaseIter impl, while keeping the .each method until callers are converted.
2013-06-23std::hashmap: Use .iter() instead of .each and similarblake2-ppc-8/+7
2013-06-23std::hashmap: Add test_iterate for HashSetblake2-ppc-0/+14
2013-06-23std::hashmap: Implement external iterator for HashMap and HashSetblake2-ppc-12/+79
2013-06-23vec: remove BaseIter implementationDaniel Micay-2/+3
I removed the `static-method-test.rs` test because it was heavily based on `BaseIter` and there are plenty of other more complex uses of static methods anyway.
2013-06-18replace #[inline(always)] with #[inline]. r=burningtree.Graydon Hoare-11/+11
2013-06-13auto merge of #7105 : sstewartgallus/rust/removed_unused_imports, r=sanxiynbors-1/+1
I was able to remove unused imports, and fix the following warnings src/libstd/hashmap.rs:23:15: 23:23 warning: unused import [-W unused-imports (default)] src/libstd/task/spawn.rs:95:15: 95:23 warning: unused import [-W unused-imports (default)] src/libstd/rt/uv/mod.rs:42:0: 42:9 warning: unused import [-W unused-imports (default)] src/libstd/rt/uv/mod.rs:45:0: 45:9 warning: unused import [-W unused-imports (default)] src/librustc/middle/trans/meth.rs:26:0: 26:26 warning: unused import [-W unused-imports (default)] src/librustc/back/link.rs:210:20: 210:25 warning: unused import [-W unused-imports (default)] I was unable to fix the following unused import warnings. The code here was weird. src/libextra/std.rc:40:11: 40:14 warning: unused import [-W unused-imports (default)] src/libextra/std.rc:40:16: 40:24 warning: unused import [-W unused-imports (default)]
2013-06-13Remove unused importsSteven Stewart-Gallus-1/+1
I was able to remove unused imports, and fix the following warnings src/libstd/hashmap.rs:23:15: 23:23 warning: unused import [-W unused-imports (default)] src/libstd/task/spawn.rs:95:15: 95:23 warning: unused import [-W unused-imports (default)] src/libstd/rt/uv/mod.rs:42:0: 42:9 warning: unused import [-W unused-imports (default)] src/libstd/rt/uv/mod.rs:45:0: 45:9 warning: unused import [-W unused-imports (default)] src/librustc/middle/trans/meth.rs:26:0: 26:26 warning: unused import [-W unused-imports (default)] src/librustc/back/link.rs:210:20: 210:25 warning: unused import [-W unused-imports (default)] I was unable to fix the following unused import warnings. The code here was weird. src/libextra/std.rc:40:11: 40:14 warning: unused import [-W unused-imports (default)] src/libextra/std.rc:40:16: 40:24 warning: unused import [-W unused-imports (default)]
2013-06-13hashmap: remove leftover debug!() loggingDaniel Micay-7/+1
2013-06-12std: add a test for HashMap::find_equiv.Huon Wilson-0/+17
2013-06-11option: remove redundant old_iter implsDaniel Micay-1/+2
2013-06-02Add a get_mut method to accompany the get method.gareth-0/+9
2013-06-01Add new function hashmap.insert_or_update_with()Kevin Ballard-0/+15
fn insert_or_update_with<'a>(&'a mut self, k: K, f: &fn(&K, &mut V)) -> &'a V
2013-06-01Refactor some hashmap code into a new private function mangle()Kevin Ballard-37/+21
Add new private hashmap function fn mangle(&mut self, k: K, not_found: &fn(&K) -> V, found: &fn(&K, &mut V)) -> uint Rewrite find_or_insert() and find_or_insert_with() on top of mangle(). Also take the opportunity to change the return type of find_or_insert() and find_or_insert_with() to &'a mut V. This fixes #6394.
2013-06-01Remove all uses of `pub impl`. rs=stylePatrick Walton-20/+30
2013-05-30Fix a bug with HashMap::consumeAlex Crichton-3/+19
2013-05-30Require documentation by default for libstdAlex Crichton-0/+12
Adds documentation for various things that I understand. Adds #[allow(missing_doc)] for lots of things that I don't understand.
2013-05-22libstd: Rename libcore to libstd and libstd to libextra; update makefiles.Patrick Walton-0/+989
This only changes the directory names; it does not change the "real" metadata names.