about summary refs log tree commit diff
path: root/src/libextra/ringbuf.rs
AgeCommit message (Collapse)AuthorLines
2013-08-15std: Move the iterator param on FromIterator and Extendable to the method.Huon Wilson-4/+4
If they are on the trait then it is extremely annoying to use them as generic parameters to a function, e.g. with the iterator param on the trait itself, if one was to pass an Extendable<int> to a function that filled it either from a Range or a Map<VecIterator>, one needs to write something like: fn foo<E: Extendable<int, Range<int>> + Extendable<int, Map<&'self int, int, VecIterator<int>>> (e: &mut E, ...) { ... } since using a generic, i.e. `foo<E: Extendable<int, I>, I: Iterator<int>>` means that `foo` takes 2 type parameters, and the caller has to specify them (which doesn't work anyway, as they'll mismatch with the iterators used in `foo` itself). This patch changes it to: fn foo<E: Extendable<int>>(e: &mut E, ...) { ... }
2013-08-10std: Iterator.take_ -> .takeErick Tryzelaar-1/+1
2013-08-10std: Rename Iterator.transform -> .mapErick Tryzelaar-2/+2
cc #5898
2013-08-06iterator: rename `Counter::new` to `count`Daniel Micay-1/+1
to match the convention used by `range`, since `iterator::count` is already namespaced enough and won't be ambiguous
2013-08-05Updated std::Option, std::Either and std::ResultMarvin Löbel-6/+6
- Made naming schemes consistent between Option, Result and Either - Changed Options Add implementation to work like the maybe monad (return None if any of the inputs is None) - Removed duplicate Option::get and renamed all related functions to use the term `unwrap` instead
2013-08-03remove obsolete `foreach` keywordDaniel Micay-18/+18
this has been replaced by `for`
2013-08-02replace `range` with an external iteratorDaniel Micay-15/+13
2013-08-01std: Change `Times` trait to use `do` instead of `for`blake2-ppc-1/+1
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-08-01migrate many `for` loops to `foreach`Daniel Micay-5/+5
2013-07-30extra: Implement iterator::Extendableblake2-ppc-4/+11
2013-07-30extra: Implement RandomAccessIterator for RingBufblake2-ppc-15/+26
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-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-3/+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-20Use Option .take() or .take_unwrap() instead of util::replace where possibleblake2-ppc-3/+2
2013-07-17test: Fix tests.Patrick Walton-15/+15
2013-07-17librustc: Remove all uses of "copy".Patrick Walton-26/+32
2013-07-16ringbuf: Implement DoubleEndedIteratorblake2-ppc-34/+37
2013-07-14ringbuf: Implement .size_hint() for iteratorsblake2-ppc-0/+15
2013-07-11extra: Mention extra::container::Deque trait in doc for RingBuf and DListblake2-ppc-1/+4
2013-07-11extra: Rename deque::Deque to ringbuf::RingBuf and impl trait Dequeblake2-ppc-0/+705
Let RingBuf have a logical name for a concrete type, and Deque is used for the Deque trait (implemented by RingBuf and dlist).