Commit Graph

31 Commits

Author SHA1 Message Date
gifnksm 8edb8f6d39 iterator: Add IteratorUtil::max_by/min_by method 2013-06-27 06:55:22 +09:00
bors 3433851a37 auto merge of #7345 : blake2-ppc/rust/iterator-flat-map, r=thestinger
flat_map_ produces an iterator that maps each element to an iterator,
and yields the elements of the produced iterators.

This is the monadic bind :: M a -> (a -> M b) -> M b  for iterators.

Named just like the vec method, but with a trailing underline until the
method resolution bug is resolved.

We discussed the name chain_map, but I decided to go with flat_map_ for consistency with vec.

Since it.map(f).flatten()  would be the same as it.flat_map(f), we could choose
to just implement a flatten method instead. Either way the possibilities are the same but flat_map is more convenient.
2013-06-26 09:47:16 -07:00
James Miller caa50ce15d Remove stage0 cfgs 2013-06-25 17:08:26 +12:00
blake2-ppc 6291702cf3 iterator: Add IteratorUtil::flat_map_ method
flat_map_ produces an iterator that maps each element to an iterator,
and yields the elements of the produced iterators.

This is the monadic bind :: M a -> (a -> M b) -> M b  for iterators.

Named just like the vec method, but with a trailing underline until the
method resolution bug is resolved.
2013-06-24 12:50:41 +02:00
Daniel Micay 3ab5ec4b7c iterator: implement collect with FromIterator
This makes it take advantage of the size hint for pre-allocation.
2013-06-24 01:35:15 -04:00
Daniel Micay c9342663df iterator: add a FromIterator trait
This is able to take advantage of the lower bound from the size hint.
2013-06-22 15:59:59 -04:00
Daniel Micay 468cbd9d01 iterator: add a size_hint default method
also adds an implementation for the vector iterators
2013-06-22 15:59:59 -04:00
Daniel Micay 883c966d5c vec: replace position with iter().position_ 2013-06-21 03:23:59 -04:00
Daniel Micay 49c74524e2 vec: rm old_iter implementations, except BaseIter
The removed test for issue #2611 is well covered by the `std::iterator`
module itself.

This adds the `count` method to `IteratorUtil` to replace `EqIter`.
2013-06-21 03:20:22 -04:00
Graydon Hoare d904c72af8 replace #[inline(always)] with #[inline]. r=burningtree. 2013-06-18 14:48:48 -07:00
bors fd8aa9afbd auto merge of #7177 : huonw/rust/unfold-fix, r=thestinger 2013-06-16 10:55:02 -07:00
Huon Wilson 53f6a4e9fb std: fix UnfoldrIterator cross-crate. 2013-06-16 18:13:45 +10:00
Daniel Micay 79cd2dbe72 iterator: work around method resolve bug 2013-06-15 18:02:05 -04:00
Daniel Micay 2df66a84cd iterator: add a position adaptor 2013-06-15 17:56:54 -04:00
Daniel Micay eb5ac84c8e iterator: add a find adaptor 2013-06-15 17:53:12 -04:00
Daniel Micay 585f5f7f79 add IteratorUtil to the prelude 2013-06-14 23:15:42 -04:00
bors 78cddc83a4 auto merge of #7073 : influenza/rust/iterator-doc-fixes, r=catamorphism
This commit fixes two typos and an incorrect description.
2013-06-12 12:13:53 -07:00
Ron Dahlgren 37489a67e5 Iterator documentation fixes
Fixes two typos and one incorrect description.
2013-06-11 16:34:03 -07:00
Daniel Micay 004816f4c6 option: remove redundant old_iter impls 2013-06-11 14:06:12 -04:00
Huon Wilson 98ba91f81b remove unused import warnings 2013-06-09 02:22:23 +10:00
Huon Wilson 65c7c58c8f std: remove {all*,any*,count} in favour of iterators 2013-06-09 02:22:23 +10:00
Daniel Micay 07e4d69baa iterator: work around method resolve bug (#5898) 2013-06-07 14:50:06 -04:00
Huon Wilson 5e9f006c5b std: more dummy type parameters on iterators to work around #6967. 2013-06-08 01:10:27 +10:00
Marvin Löbel cac4891154 Fixups 2013-06-06 22:40:35 +02:00
Marvin Löbel 070015468d Removed IteratorUtil::to_vec and iter::to_vec 2013-06-06 22:11:48 +02:00
Marvin Löbel 857d433b9a Added IteratorUtil::collect 2013-06-06 22:11:48 +02:00
Huon Wilson 32228f3d57 std: work-around for take/skip type inference (#6967) 2013-06-06 16:40:12 +10:00
Daniel Farina aef1e10eba Remove unnecessary 'use' forms
Fix a laundry list of warnings involving unused imports that glutted
up compilation output.  There are more, but there seems to be some
false positives (where 'remedy' appears to break the build), but this
particular set of fixes seems safe.
2013-05-30 13:08:18 -07:00
Alex Crichton 007651cd26 Require documentation by default for libstd
Adds documentation for various things that I understand.
Adds #[allow(missing_doc)] for lots of things that I don't understand.
2013-05-30 01:02:55 -05:00
Patrick Walton 206ab89629 librustc: Stop reexporting the standard modules from prelude. 2013-05-29 19:04:53 -07:00
Patrick Walton 0c820d4123 libstd: Rename libcore to libstd and libstd to libextra; update makefiles.
This only changes the directory names; it does not change the "real"
metadata names.
2013-05-22 21:57:05 -07:00