about summary refs log tree commit diff
path: root/src/libstd/iter.rs
AgeCommit message (Collapse)AuthorLines
2014-02-22Move std::num::Integer to libnumBrendan Zabarauskas-7/+7
2014-02-18Spellcheck library docs.Huon Wilson-1/+1
2014-02-17Remove CloneableTuple and ImmutableTuple traitsBrendan Zabarauskas-1/+1
These are adequately covered by the Tuple2 trait.
2014-02-11Fix broken link to the container guideSimon Sapin-1/+1
2014-02-11Move replace and swap to std::mem. Get rid of std::utilEdward Wang-2/+2
Also move Void to std::any, move drop to std::mem and reexport in prelude.
2014-01-31auto merge of #11789 : pongad/rust/master, r=kballardbors-0/+148
All tests passing. #5268
2014-01-31Fix minor doc typosVirgile Andreani-1/+1
2014-02-01Added minmax function.Michael Darakananda-0/+148
Tests ok
2014-01-25auto merge of #11790 : lfairy/rust/rename-num-consts, r=alexcrichtonbors-13/+13
The following are renamed: * `min_value` => `MIN` * `max_value` => `MAX` * `bits` => `BITS` * `bytes` => `BYTES` All tests pass, except for `run-pass/phase-syntax-link-does-resolve.rs`. I doubt that failure is related, though. Fixes #10010.
2014-01-25Uppercase numeric constantsChris Wong-13/+13
The following are renamed: * `min_value` => `MIN` * `max_value` => `MAX` * `bits` => `BITS` * `bytes` => `BYTES` Fixes #10010.
2014-01-25Fixed iter's is_empty to use is_none() and added relevant test flagSalem Talha-1/+2
2014-01-23Update flip() to be rev().Sean Chalmers-24/+24
Consensus leaned in favour of using rev instead of flip.
2014-01-23Rename Invert to Flip - Issue 10632Sean Chalmers-26/+26
Renamed the invert() function in iter.rs to flip(). Also renamed the Invert<T> type to Flip<T>. Some related code comments changed. Documentation that I could find has been updated, and all the instances I could locate where the function/type were called have been updated as well.
2014-01-20Add operator trait constraints to std::num::{Zero, One} and document their ↵Brendan Zabarauskas-0/+6
appropriate use Zero and One have precise definitions in mathematics. Documentation has been added to describe the appropriate uses for these traits and the laws that they should satisfy. For more information regarding these identities, see the following wikipedia pages: - http://wikipedia.org/wiki/Additive_identity - http://wikipedia.org/wiki/Multiplicative_identity
2014-01-14renamed empty() to is_empty()Shamir Khodzha-4/+4
2014-01-11added empty() to PeekableShamir Khodzha-1/+15
2014-01-11Remove re-exports of std::io::stdio::{print, println} in the prelude.Brendan Zabarauskas-1/+1
The `print!` and `println!` macros are now the preferred method of printing, and so there is no reason to export the `stdio` functions in the prelude. The functions have also been replaced by their macro counterparts in the tutorial and other documentation so that newcomers don't get confused about what they should be using.
2014-01-08Renamed Option::map_default and mutate_default to map_or and mutate_or_setMarvin Löbel-2/+2
2013-12-27Renamed ClonableIterator to CloneableIteratorAlexandros Tasos-4/+4
2013-12-23std: Fix all code examplesAlex Crichton-19/+27
2013-12-20Implement size_hint() for ByRef iteratorPalmer Cox-1/+2
2013-12-15std: fix spelling in docs.Huon Wilson-2/+2
2013-12-11Make 'self lifetime illegal.Erik Price-50/+50
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-12-08Remove dead codesKiet Tran-1/+1
2013-11-26test: Remove non-procedure uses of `do` from compiletest, libstd tests,Patrick Walton-2/+2
compile-fail tests, run-fail tests, and run-pass tests.
2013-11-26librustc: Remove remaining uses of `&fn()` in favor of `||`.Patrick Walton-19/+19
2013-11-19libstd: Change all uses of `&fn(A)->B` over to `|A|->B` in libstdPatrick Walton-10/+10
2013-11-17Fixed docs for advance() in Iterator traitAndrei Formiga-6/+3
2013-11-17Fixed uses of get() to unwrap() in doc examples in std::iterAndrei Formiga-28/+28
2013-11-11Implement `size_hint` for RangeCorey Richardson-8/+80
Closes #8606
2013-10-23Removed unnecessary comments and white spaces as suggestedreedlepee-27/+1
2013-10-23Removed Unnecessary comments and white spaces #4386reedlepee-2/+0
2013-10-23Making fields in std and extra : private #4386reedlepee-3/+31
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-6/+6
Who doesn't like a massive renaming?
2013-10-16auto merge of #9634 : blake2-ppc/rust/by-ref-iter, r=thestingerbors-0/+44
std::iter: Introduce .by_ref() adaptor Creates a wrapper around a mutable reference to the iterator. This is useful to allow applying iterator adaptors while still retaining ownership of the original iterator value. Example:: let mut xs = range(0, 10); // sum the first five values let partial_sum = xs.by_ref().take(5).fold(0, |a, b| a + b); assert!(partial_sum == 10); // xs.next() is now `5` assert!(xs.next() == Some(5)); --- This adaptor requires the user to have good understanding of iterators or what a particular adaptor does. There could be some pitfalls here with the iterator protocol, it's mostly the same issues as other places regarding what happens after the iterator returns None for the first time. There could also be other ways to achieve the same thing, for example Implementing iterator on `&mut T` itself: `impl <T: Iterator<..>> Iterator for &mut T` but that would only lead to confusion I think.
2013-10-09option: rewrite the API to use compositionDaniel Micay-8/+8
2013-10-02auto merge of #9665 : alexcrichton/rust/snapshot, r=brsonbors-4/+4
Uses the new snapshots to kill the old `loop` and introduce the new `continue`.
2013-10-01Migrate users of 'loop' to 'continue'Alex Crichton-4/+4
Closes #9467
2013-10-01remove the `float` typeDaniel Micay-3/+3
It is simply defined as `f64` across every platform right now. A use case hasn't been presented for a `float` type defined as the highest precision floating point type implemented in hardware on the platform. Performance-wise, using the smallest precision correct for the use case greatly saves on cache space and allows for fitting more numbers into SSE/AVX registers. If there was a use case, this could be implemented as simply a type alias or a struct thanks to `#[cfg(...)]`. Closes #6592 The mailing list thread, for reference: https://mail.mozilla.org/pipermail/rust-dev/2013-July/004632.html
2013-09-30std: Remove usage of fmt!Alex Crichton-6/+6
2013-09-30std::iter: Introduce .by_ref() adaptorblake2-ppc-0/+44
Creates a wrapper around a mutable reference to the iterator. This is useful to allow applying iterator adaptors while still retaining ownership of the original iterator value. Example:: let mut xs = range(0, 10); // sum the first five values let partial_sum = xs.by_ref().take(5).fold(0, |a, b| a + b); assert!(partial_sum == 10); // xs.next() is now `5` assert!(xs.next() == Some(5));
2013-09-26Update the compiler to not use printf/printflnAlex Crichton-1/+1
2013-09-25rustdoc: Change all code-blocks with a scriptAlex Crichton-64/+64
find src -name '*.rs' | xargs sed -i '' 's/~~~.*{\.rust}/```rust/g' find src -name '*.rs' | xargs sed -i '' 's/ ~~~$/ ```/g' find src -name '*.rs' | xargs sed -i '' 's/^~~~$/ ```/g'
2013-09-17Document a few undocumented modules in libstdAlex Crichton-4/+51
Hopefull this will make our libstd docs appear a little more "full".
2013-09-15iter: add the edge case tests for `range` tooDaniel Micay-0/+10
2013-09-15iter: fix `RangeInclusive`'s `DoubleEndedIterator`Daniel Micay-3/+5
2013-09-15iter: fix `range_inclusive` when `start > stop`Daniel Micay-4/+10
2013-09-15fix range_step{,_inclusive} with negative stepDaniel Micay-16/+10
2013-09-14iter: add `RangeStep` and `RangeStepInclusive`Daniel Micay-1/+90
2013-09-14iter: move Counter impl to the proper placeDaniel Micay-14/+14