rust/src/libcollections
Jonathan S 03609e5a5e Deprecate the rev_iter pattern in all places where a DoubleEndedIterator is provided (everywhere but treemap)
This commit deprecates rev_iter, mut_rev_iter, move_rev_iter everywhere (except treemap) and also
deprecates related functions like rsplit, rev_components, and rev_str_components. In every case,
these functions can be replaced with the non-reversed form followed by a call to .rev(). To make this
more concrete, a translation table for all functional changes necessary follows:

* container.rev_iter() -> container.iter().rev()
* container.mut_rev_iter() -> container.mut_iter().rev()
* container.move_rev_iter() -> container.move_iter().rev()
* sliceorstr.rsplit(sep) -> sliceorstr.split(sep).rev()
* path.rev_components() -> path.components().rev()
* path.rev_str_components() -> path.str_components().rev()

In terms of the type system, this change also deprecates any specialized reversed iterator types (except
in treemap), opting instead to use Rev directly if any type annotations are needed. However, since
methods directly returning reversed iterators are now discouraged, the need for such annotations should
be small. However, in those cases, the general pattern for conversion is to take whatever follows Rev in
the original reversed name and surround it with Rev<>:

* RevComponents<'a> -> Rev<Components<'a>>
* RevStrComponents<'a> -> Rev<StrComponents<'a>>
* RevItems<'a, T> -> Rev<Items<'a, T>>
* etc.

The reasoning behind this change is that it makes the standard API much simpler without reducing readability,
performance, or power. The presence of functions such as rev_iter adds more boilerplate code to libraries
(all of which simply call .iter().rev()), clutters up the documentation, and only helps code by saving two
characters. Additionally, the numerous type synonyms that were used to make the type signatures look nice
like RevItems add even more boilerplate and clutter up the docs even more. With this change, all that cruft
goes away.

[breaking-change]
2014-04-28 16:45:36 -05:00
..
bitv.rs Deprecate the rev_iter pattern in all places where a DoubleEndedIterator is provided (everywhere but treemap) 2014-04-28 16:45:36 -05:00
btree.rs Fix misspellings in comments. 2014-04-21 00:49:39 -04:00
deque.rs libtest: rename BenchHarness to Bencher 2014-04-11 17:31:13 +08:00
dlist.rs Deprecate the rev_iter pattern in all places where a DoubleEndedIterator is provided (everywhere but treemap) 2014-04-28 16:45:36 -05:00
enum_set.rs collections: replace all ~[T] with Vec<T>. 2014-04-09 09:58:17 +10:00
hashmap.rs auto merge of #13653 : jbcrail/rust/fix-comment-mistakes, r=alexcrichton 2014-04-22 05:06:33 -07:00
lib.rs collections: replace all ~[T] with Vec<T>. 2014-04-09 09:58:17 +10:00
lru_cache.rs auto merge of #13618 : yuriks/rust/lru-cache, r=brson 2014-04-21 23:01:39 -07:00
priority_queue.rs Deprecate the rev_iter pattern in all places where a DoubleEndedIterator is provided (everywhere but treemap) 2014-04-28 16:45:36 -05:00
ringbuf.rs Deprecate the rev_iter pattern in all places where a DoubleEndedIterator is provided (everywhere but treemap) 2014-04-28 16:45:36 -05:00
smallintmap.rs Deprecate the rev_iter pattern in all places where a DoubleEndedIterator is provided (everywhere but treemap) 2014-04-28 16:45:36 -05:00
treemap.rs Fix misspellings in comments. 2014-04-21 00:49:39 -04:00
trie.rs Deprecate the rev_iter pattern in all places where a DoubleEndedIterator is provided (everywhere but treemap) 2014-04-28 16:45:36 -05:00