about summary refs log tree commit diff
path: root/src/libextra/ringbuf.rs
AgeCommit message (Collapse)AuthorLines
2014-02-07moved collections from libextra into libcollectionsHeroesGrave-858/+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-02-04auto merge of #11951 : dmanescu/rust/reserve-rename, r=huonwbors-10/+10
Changes in std::{str,vec,hashmap} and extra::{priority_queue,ringbuf}. Fixes #11949
2014-02-04Rename reserve to reserve_exact and reserve_at_least to reserveDavid Manescu-10/+10
Changes in std::{str,vec,hashmap} and extra::{priority_queue,ringbuf}. Fixes #11949
2014-01-30Make pop_ref and mut_pop_ref return Option instead of failing on empty vectorsNathaniel Herman-1/+1
2014-01-30Make shift_ref and mut_shift_ref return Option instead of failingNathaniel Herman-1/+1
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-23Update flip() to be rev().Sean Chalmers-5/+5
Consensus leaned in favour of using rev instead of flip.
2014-01-23Rename Invert to Flip - Issue 10632Sean Chalmers-5/+5
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-18Rename iterators for consistencyPalmer Cox-16/+16
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-2/+3
2013-12-11Make 'self lifetime illegal.Erik Price-17/+17
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-12-02rename MutableVector::mut_split(at) to MutableVector::mut_split_at(at)Guillaume Pinot-3/+3
2013-11-28auto merge of #10519 : ↵bors-47/+108
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-47/+108
2013-11-26test: Remove all remaining non-procedure uses of `do`.Patrick Walton-10/+10
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-12/+12
Who doesn't like a massive renaming?
2013-09-30extra: Remove usage of fmt!Alex Crichton-12/+12
2013-09-26extra::ringbuf: Implement method `.swap(uint, uint)` just like vectorblake2-ppc-0/+21
RingBuf::swap(&mut self, i, j) swaps the element at indices `i` and `j` if both elements are in bounds, otherwise it fails.
2013-09-09rename `std::iterator` to `std::iter`Daniel Micay-3/+3
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-01std/extra: Add ExactSize for Bitv, DList, RingBuf, Option iteratorsblake2-ppc-0/+4
2013-08-27librustc: Ensure that type parameters are in the right positions in paths.Patrick Walton-1/+1
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-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).