Skip to content

Commit 296e646

Browse files
author
blake2-ppc
committed
---
yaml --- r: 142818 b: refs/heads/try2 c: e1d5d1c h: refs/heads/master v: v3
1 parent f94dc8b commit 296e646

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 89a0c99dbee1c1327e8f8a8e5127127e2b3de88e
8+
refs/heads/try2: e1d5d1c049608cf182ddc91c98d9700089a35600
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libextra/dlist.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,6 @@ pub struct ConsumeIterator<T> {
7272
priv list: DList<T>
7373
}
7474

75-
/// DList reverse consuming iterator
76-
pub struct ConsumeRevIterator<T> {
77-
priv list: DList<T>
78-
}
79-
8075
/// Rawlink is a type like Option<T> but for holding a raw pointer
8176
impl<T> Rawlink<T> {
8277
/// Like Option::None for Rawlink
@@ -346,8 +341,8 @@ impl<T> DList<T> {
346341
}
347342

348343
/// Consume the list into an iterator yielding elements by value, in reverse
349-
pub fn consume_rev_iter(self) -> ConsumeRevIterator<T> {
350-
ConsumeRevIterator{list: self}
344+
pub fn consume_rev_iter(self) -> InvertIterator<T, ConsumeIterator<T>> {
345+
self.consume_iter().invert()
351346
}
352347
}
353348

@@ -494,11 +489,8 @@ impl<A> Iterator<A> for ConsumeIterator<A> {
494489
}
495490
}
496491

497-
impl<A> Iterator<A> for ConsumeRevIterator<A> {
498-
fn next(&mut self) -> Option<A> { self.list.pop_back() }
499-
fn size_hint(&self) -> (uint, Option<uint>) {
500-
(self.list.length, Some(self.list.length))
501-
}
492+
impl<A> DoubleEndedIterator<A> for ConsumeIterator<A> {
493+
fn next_back(&mut self) -> Option<A> { self.list.pop_back() }
502494
}
503495

504496
impl<A, T: Iterator<A>> FromIterator<A, T> for DList<A> {

0 commit comments

Comments
 (0)