about summary refs log tree commit diff
path: root/src/libextra/priority_queue.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: Rename Iterator.transform -> .mapErick Tryzelaar-1/+1
cc #5898
2013-08-03remove obsolete `foreach` keywordDaniel Micay-3/+3
this has been replaced by `for`
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-3/+3
2013-07-30extra: Implement iterator::Extendableblake2-ppc-7/+14
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-17test: Fix tests.Patrick Walton-1/+2
2013-07-17librustc: Remove all uses of "copy".Patrick Walton-2/+2
2013-07-14Stripped trailing spaces; Implemented FromIterator for TreeMap and PriorityQueue=Mark Sinclair-0/+27
2013-07-06Implement size_hint() on all remaining IteratorsKevin Ballard-0/+3
Add size_hint() to the Iterators in libextra and the Iterator in libsyntax. Skip deque for the moment, as it's being worked on elsewhere.
2013-06-30Convert vec::{reverse, swap} to methods.Huon Wilson-1/+1
2013-06-29Great renaming: propagate throughout the rest of the codebaseCorey Richardson-4/+3
2013-06-28Convert vec::{reserve, reserve_at_least, capacity} to methods.Huon Wilson-3/+3
2013-06-26priority_queue: implement simple iteratorRamkumar Ramachandra-4/+27
Remove PriorityQueue::each and replace it with PriorityQueue::iter, which ultimately calls into vec::VecIterator via PriorityQueueIterator. Implement iterator::Iterator for PriorityQueueIterator. Now you should be able to do: extern mod extra; let mut pq = extra::priority_queue::PriorityQueue::new(); pq.push(5); pq.push(6); pq.push(3); for pq.iter().advance |el| { println(fmt!("%d", *el)); } just like you iterate over vectors, hashmaps, hashsets etc. Note that the iteration order is arbitrary (as before with PriorityQueue::each), and _not_ the order you get when you pop() repeatedly. Add an in-file test to guard this. Reported-by: Daniel Micay <danielmicay@gmail.com> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
2013-06-24remove old_iterDaniel Micay-11/+6
the `test/run-pass/class-trait-bounded-param.rs` test was xfailed and written in an ancient dialect of Rust so I've just removed it this also removes `to_vec` from DList because it's provided by `std::iter::to_vec` an Iterator implementation is added for OptVec but some transitional internal iterator methods are still left
2013-06-23vec: remove BaseIter implementationDaniel Micay-2/+2
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-15rm vec::uniq_lenDaniel Micay-2/+2
2013-06-09cmp: remove duplicate free functionsDaniel Micay-5/+5
2013-06-01Remove all uses of `pub impl`. rs=stylePatrick Walton-19/+20
2013-05-30libextra: Require documentation by defaultAlex Crichton-0/+1
2013-05-29librustc: Stop reexporting the standard modules from prelude.Patrick Walton-0/+1
2013-05-23cleanup warnings from libextraErick Tryzelaar-1/+0
2013-05-22test: Update tests and import the prelude in some more places.Patrick Walton-12/+12
2013-05-22libextra: Rename the actual metadata names of libcore to libstd and libstd ↵Patrick Walton-0/+2
to libextra
2013-05-22libstd: Rename libcore to libstd and libstd to libextra; update makefiles.Patrick Walton-0/+320
This only changes the directory names; it does not change the "real" metadata names.