summary refs log tree commit diff
path: root/src/libstd/iter.rs
AgeCommit message (Collapse)AuthorLines
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
2013-09-14iter: replace comment with a docstringDaniel Micay-5/+3
2013-09-14iter: fix range docstringsDaniel Micay-2/+2
2013-09-12std: Restore Option::chain{,_mut}_ref as and_then{,_mut}_refErick Tryzelaar-12/+2
2013-09-12std: Rename {Option,Result}::chain{,_err}* to {and_then,or_else}Erick Tryzelaar-5/+14
2013-09-09rename `std::iterator` to `std::iter`Daniel Micay-0/+2659
The trait will keep the `Iterator` naming, but a more concise module name makes using the free functions less verbose. The module will define iterables in addition to iterators, as it deals with iteration in general.
2013-08-29Remove the iter module.Jason Fager-26/+0
Moves the Times trait to num while the question of whether it should exist at all gets hashed out as a completely separate question.
2013-08-01std: Change `Times` trait to use `do` instead of `for`blake2-ppc-2/+2
Change the former repetition:: for 5.times { } to:: do 5.times { } .times() cannot be broken with `break` or `return` anymore; for those cases, use a numerical range loop instead.
2013-07-01Move most iter functionality to extra, fixes #7343Jordi Boggiano-302/+5
2013-06-23vec: remove BaseIter implementationDaniel Micay-18/+18
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-5/+5
2013-06-14add IteratorUtil to the preludeDaniel Micay-2/+0
2013-06-09remove unused import warningsHuon Wilson-1/+0
2013-06-06FixupsMarvin Löbel-11/+1
2013-06-06Removed IteratorUtil::to_vec and iter::to_vecMarvin Löbel-33/+11
2013-06-06Added iter::FromIterMarvin Löbel-3/+31
2013-05-30Require documentation by default for libstdAlex Crichton-0/+1
Adds documentation for various things that I understand. Adds #[allow(missing_doc)] for lots of things that I don't understand.
2013-05-29librustc: Stop reexporting the standard modules from prelude.Patrick Walton-0/+3