about summary refs log tree commit diff
path: root/src/libextra/dlist.rs
AgeCommit message (Collapse)AuthorLines
2014-02-07moved collections from libextra into libcollectionsHeroesGrave-1204/+0
2014-02-05pull extra::{serialize, ebml} into a separate libserialize crateJeff Olson-0/+27
- `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-2/+2
`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-29Removing do keyword from libextraScott Lawrence-2/+2
2014-01-28syntax: make deriving have slightly less cryptic error messages.Huon Wilson-1/+5
This unfortunately changes an error like error: mismatched types: expected `&&NotClone` but found `&NotClone` into error: type `NotClone` does not implement any method in scope named `clone`
2014-01-26Fix privacy fallout from previous changeAlex Crichton-4/+4
2014-01-23Update flip() to be rev().Sean Chalmers-7/+7
Consensus leaned in favour of using rev instead of flip.
2014-01-23Rename Invert to Flip - Issue 10632Sean Chalmers-7/+7
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-21[std::vec] Rename .shift_opt() to .shift(), drop the old .shift() behaviorSimon Sapin-1/+1
2014-01-21[std::vec] Rename .pop_opt() to .pop(), drop the old .pop() behaviorSimon Sapin-1/+1
2014-01-18Rename iterators for consistencyPalmer Cox-23/+23
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-07extratest: Fix all leaked trait importsAlex Crichton-32/+32
2014-01-08Renamed Option::map_default and mutate_default to map_or and mutate_or_setMarvin Löbel-1/+1
2013-12-11Make 'self lifetime illegal.Erik Price-16/+16
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-11-28Register new snapshotsAlex Crichton-2/+2
2013-11-28auto merge of #10519 : ↵bors-2/+3
nikomatsakis/rust/issue-8624-borrowck-overly-permissive, r=pnkfelix See #8624 for details. r? @pnkfelix
2013-11-28Modify iterators to make them safe with the new rules.Niko Matsakis-2/+3
2013-11-26test: Remove all remaining non-procedure uses of `do`.Patrick Walton-24/+24
2013-11-26librustuv: Remove all non-`proc` uses of `do` from `libextra` andPatrick Walton-16/+16
`librustuv`.
2013-11-19libextra: Convert uses of `&fn(A)->B` to `|A|->B`.Patrick Walton-2/+2
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-15/+18
2013-09-30extra: Remove usage of fmt!Alex Crichton-2/+2
2013-09-16switch Drop to `&mut self`Daniel Micay-8/+5
2013-09-09rename `std::iterator` to `std::iter`Daniel Micay-8/+8
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-09-03auto merge of #8884 : blake2-ppc/rust/exact-size-hint, r=huonwbors-0/+3
The message of the first commit explains (edited for changed trait name): The trait `ExactSize` is introduced to solve a few small niggles: * We can't reverse (`.invert()`) an enumeration iterator * for a vector, we have `v.iter().position(f)` but `v.rposition(f)`. * We can't reverse `Zip` even if both iterators are from vectors `ExactSize` is an empty trait that is intended to indicate that an iterator, for example `VecIterator`, knows its exact finite size and reports it correctly using `.size_hint()`. Only adaptors that preserve this at all times, can expose this trait further. (Where here we say finite for fitting in uint). --- It may seem complicated just to solve these small "niggles", (It's really the reversible enumerate case that's the most interesting) but only a few core iterators need to implement this trait. While we gain more capabilities generically for some iterators, it becomes a tad more complicated to figure out if a type has the right trait impls for it.
2013-09-01std/extra: Add ExactSize for Bitv, DList, RingBuf, Option iteratorsblake2-ppc-0/+3
2013-08-29extra::dlist: Fix bug in Eq::neblake2-ppc-1/+5
2013-08-27librustc: Ensure that type parameters are in the right positions in paths.Patrick Walton-9/+9
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-5/+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-12auto merge of #8400 : blake2-ppc/rust/seq-ord, r=cmrbors-3/+61
Use Eq + Ord for lexicographical ordering of sequences. For each of <, <=, >= or > as R, use:: [x, ..xs] R [y, ..ys] = if x != y { x R y } else { xs R ys } Previous code using `a < b` and then `!(b < a)` for short-circuiting fails on cases such as [1.0, 2.0] < [0.0/0.0, 3.0], where the first element was effectively considered equal. Containers like &[T] did also implement only one comparison operator `<`, and derived the comparison results from this. This isn't correct either for Ord. Implement functions in `std::iterator::order::{lt,le,gt,ge,equal,cmp}` that all iterable containers can use for lexical order. We also visit tuple ordering, having the same problem and same solution (but differing implementation).
2013-08-10std: Iterator.len_ -> .lenErick Tryzelaar-4/+4
2013-08-10std: Rename Iterator.transform -> .mapErick Tryzelaar-7/+7
cc #5898
2013-08-10Mass rename of .consume{,_iter}() to .move_iter()Erick Tryzelaar-14/+14
cc #7887
2013-08-08extra::dlist: Use iterator::order for sequence orderingblake2-ppc-3/+61
2013-08-07core: option.map_consume -> option.map_moveErick Tryzelaar-10/+10
2013-08-04extra: Don't recurse in DList drop glue. #8295Brian Anderson-4/+38
The compiler-generated dtor for DList recurses deeply to drop Nodes. For big lists this can overflow the stack.
2013-08-03remove obsolete `foreach` keywordDaniel Micay-9/+9
this has been replaced by `for`
2013-08-02replace `range` with an external iteratorDaniel Micay-2/+1
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-8/+8
2013-07-30extra: Implement iterator::Extendableblake2-ppc-2/+8
2013-07-29std: Rename Iterator adaptor types to drop the -Iterator suffixblake2-ppc-4/+4
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-27Remove dummy type parameters from iterator adaptorsblake2-ppc-4/+3
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-23dlist: Rename rotate methods to .rotate_forward() and .rotate_backward()blake2-ppc-15/+15
2013-07-22dlist: Fix .peek_next() w.r.t double ended iteratorsblake2-ppc-1/+6
.peek_next() needs to check the element counter just like the .next() and .next_back() iterators do. Also clarify .insert_next() doc w.r.t double ended iteration.
2013-07-21dlist: Remove extraneous unwrap in .pop_back_node()blake2-ppc-3/+3
2013-07-21dlist: Use Ord for .insert_ordered()blake2-ppc-3/+2
We don't need TotalOrd for ordered insertion, just the normal sort order Ord.
2013-07-21dlist: Remove bench tests for vecblake2-ppc-37/+1
These tests for ~[] performance don't really belong here, they were for comparison.
2013-07-21dlist: Add bench test for rotate_to_{front, back}blake2-ppc-0/+19