about summary refs log tree commit diff
path: root/src/libextra/treemap.rs
AgeCommit message (Collapse)AuthorLines
2014-02-07moved collections from libextra into libcollectionsHeroesGrave-1803/+0
2014-02-05pull extra::{serialize, ebml} into a separate libserialize crateJeff Olson-0/+67
- `extra::json` didn't make the cut, because of `extra::json` required dep on `extra::TreeMap`. If/when `extra::TreeMap` moves out of `extra`, then `extra::json` could move into `serialize` - `libextra`, `libsyntax` and `librustc` depend on the newly created `libserialize` - The extensions to various `extra` types like `DList`, `RingBuf`, `TreeMap` and `TreeSet` for `Encodable`/`Decodable` were moved into the respective modules in `extra` - There is some trickery, evident in `src/libextra/lib.rs` where a stub of `extra::serialize` is set up (in `src/libextra/serialize.rs`) for use in the stage0 build, where the snapshot rustc is still making deriving for `Encodable` and `Decodable` point at extra. Big props to @huonw for help working out the re-export solution for this extra: inline extra::serialize stub fix stuff clobbered in rebase + don't reexport serialize::serialize no more globs in libserialize syntax: fix import of libserialize traits librustc: fix bad imports in encoder/decoder add serialize dep to librustdoc fix failing run-pass tests w/ serialize dep adjust uuid dep more rebase de-clobbering for libserialize fixing tests, pushing libextra dep into cfg(test) fix doc code in extra::json adjust index.md links to serialize and uuid library
2014-01-30Remove Times traitBrendan Zabarauskas-6/+6
`Times::times` was always a second-class loop because it did not support the `break` and `continue` operations. Its playful appeal was then lost after `do` was disabled for closures. It's time to let this one go.
2014-01-21[std::vec] Rename .remove_opt() to .remove(), drop the old .remove() behaviorSimon Sapin-1/+1
2014-01-21[std::vec] Rename .pop_opt() to .pop(), drop the old .pop() behaviorSimon Sapin-2/+2
2014-01-18Rename iterators for consistencyPalmer Cox-71/+71
Rename existing iterators to get rid of the Iterator suffix and to give them names that better describe the things being iterated over.
2014-01-13Add Clone to TreeSetYehuda Katz-0/+11
2014-01-08Renamed Option::map_default and mutate_default to map_or and mutate_or_setMarvin Löbel-5/+5
2014-01-08extra::treemap: use the dummy-macro trick with items to make theHuon Wilson-16/+13
iterator macro properly hygiene. Requires less repetition of `mut` or not too.
2014-01-06extra::treemap: share code between the mutable and immutable iterators.Huon Wilson-271/+205
Yay for macros.
2014-01-06extra::treemap: remove mutate_values, replaced by .mut_iter().Huon Wilson-23/+0
2014-01-06extra::treemap: add mutable-value iterators.Huon Wilson-1/+278
2013-12-17Don't allow impls to force public typesAlex Crichton-1/+1
This code in resolve accidentally forced all types with an impl to become public. This fixes it by default inheriting the privacy of what was previously there and then becoming `true` if nothing else exits. Closes #10545
2013-12-11Make 'self lifetime illegal.Erik Price-39/+39
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-11-28Register new snapshotsAlex Crichton-4/+4
2013-11-26test: Remove all remaining non-procedure uses of `do`.Patrick Walton-8/+8
2013-11-26librustuv: Remove all non-`proc` uses of `do` from `libextra` andPatrick Walton-2/+2
`librustuv`.
2013-11-26Removed unneccessary `_iter` suffixes from various APIsMarvin Löbel-9/+9
2013-11-19libextra: Convert uses of `&fn(A)->B` to `|A|->B`.Patrick Walton-6/+11
2013-10-30Forbid type parameters in inner staticsAlex Crichton-19/+28
Closes #9186
2013-10-23std::rand: add distributions::Range for generating [lo, hi).Huon Wilson-1/+1
This reifies the computations required for uniformity done by (the old) `Rng.gen_integer_range` (now Rng.gen_range), so that they can be amortised over many invocations, if it is called in a loop. Also, it makes it correct, but using a trait + impls for each type, rather than trying to coerce `Int` + `u64` to do the right thing. This also makes it more extensible, e.g. big integers could & should implement SampleRange.
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-2/+2
Who doesn't like a massive renaming?
2013-10-09option: rewrite the API to use compositionDaniel Micay-7/+7
2013-10-09std::rand: Add a trait for seeding RNGs: SeedableRng.Huon Wilson-1/+1
This provides 2 methods: .reseed() and ::from_seed that modify and create respecitively. Implement this trait for the RNGs in the stdlib for which this makes sense.
2013-09-30extra: Remove usage of fmt!Alex Crichton-2/+2
2013-09-23std: merge rand::{Rng,RngUtil} with default methods.Huon Wilson-2/+2
Also, documentation & general clean-up: - remove `gen_char_from`: better served by `sample` or `choose`. - `gen_bytes` generalised to `gen_vec`. - `gen_int_range`/`gen_uint_range` merged into `gen_integer_range` and made to be properly uniformly distributed. Fixes #8644. Minor adjustments to other functions.
2013-09-09rename `std::iterator` to `std::iter`Daniel Micay-1/+1
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-27librustc: Ensure that type parameters are in the right positions in paths.Patrick Walton-2/+3
This removes the stacking of type parameters that occurs when invoking trait methods, and fixes all places in the standard library that were relying on it. It is somewhat awkward in places; I think we'll probably want something like the `Foo::<for T>::new()` syntax.
2013-08-15std: Move the iterator param on FromIterator and Extendable to the method.Huon Wilson-8/+8
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-12Forbid pub/priv where it has no effectAlex Crichton-1/+1
Closes #5495
2013-08-11extra::treemap: Use IteratorUtil::peekableblake2-ppc-88/+46
Replace the previous equivalent iterator adaptor with .peekable(). Refactor the set operation iterators so that they are easier to read.
2013-08-10std: Rename Iterator.transform -> .mapErick Tryzelaar-2/+2
cc #5898
2013-08-10Mass rename of .consume{,_iter}() to .move_iter()Erick Tryzelaar-4/+4
cc #7887
2013-08-07extra: Remove all each_* methods in treemapblake2-ppc-39/+6
.each_key(), .each_value() and the other methods are replaced by .iter() and .rev_iter(), and restrictions of those iterators.
2013-08-07extra: Implement .rev_iter() in treemapblake2-ppc-21/+60
Implement reverse iterators for TreeMap and TreeSet, that produce the keys in backward order.
2013-08-07extra: External iterators for TreeSet set operationsblake2-ppc-114/+134
Write external iterators for Difference, Sym. Difference, Intersection and Union set operations. These iterators are generic insofar that they could work on any ordered sequence iterators, even though they are type specialized to the TreeSetIterator in this case. Looking at the `check` function in the treeset tests, rustc seems unwilling to compile a function resembling:: fn check<'a, T: Iterator<&'a int>>(... ) so the tests for these iterators are still running the legacy loop protocol.
2013-08-07extra: Simplify Eq/Ord in treemapblake2-ppc-21/+5
Write the Eq and Ord impls for TreeMap in a more straightforward way using iterator::Zip
2013-08-07core: option.map_consume -> option.map_moveErick Tryzelaar-1/+1
2013-08-04Implemented TreeMap::{lower_bound_iter,upper_bound_iter}Dmitry Ermolov-4/+146
(issue #4604)
2013-08-04Remove redundant print.Dmitry Ermolov-1/+0
2013-08-04Additional check in treemap iterator test.Dmitry Ermolov-0/+1
2013-08-03auto merge of #8264 : thestinger/rust/snapshot, r=Aatchbors-20/+20
2013-08-03remove obsolete `foreach` keywordDaniel Micay-20/+20
this has been replaced by `for`
2013-08-03Add default implementation of Map::contains_key functionStepan Koltsov-5/+0
Map::contains_key can be implemented with Map::find. Remove several implementations of contains_key.
2013-08-02replace `range` with an external iteratorDaniel Micay-3/+2
2013-08-01std: Change `Times` trait to use `do` instead of `for`blake2-ppc-5/+6
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-01std: Remove the internal iterator methods from trait Setblake2-ppc-35/+35
.intersection(), .union() etc methods in trait std::container::Set use internal iters. Remove these methods from the trait. I reported issue #8154 for the reinstatement of iterator-based set algebra methods to the Set trait. For bitv and treemap, that lack Iterator implementations of set operations, preserve them as methods directly on the types themselves. For HashSet, these methods are replaced by the present .union_iter() etc.
2013-08-01extra: Replace `for` with `do { .. }` expr where internal iterators are usedblake2-ppc-7/+10
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-18/+18
2013-07-30extra: Implement iterator::Extendableblake2-ppc-8/+18