Skip to content

Commit 4b50c2a

Browse files
author
blake2-ppc
committed
---
yaml --- r: 142453 b: refs/heads/try2 c: 07e2775 h: refs/heads/master i: 142451: e38ce47 v: v3
1 parent c5e3305 commit 4b50c2a

File tree

3 files changed

+2
-31
lines changed

3 files changed

+2
-31
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: 0ff5c17cbbef0aedfa2eb1142cbf7a87abfd1d05
8+
refs/heads/try2: 07e2775dff0643f0f8f66f5ecf92ab7ee163bce4
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libextra/deque.rs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,6 @@ impl<T> Deque<T> {
7777
get(self.elts, idx)
7878
}
7979

80-
/// Iterate over the elements in the deque
81-
pub fn each(&self, f: &fn(&T) -> bool) -> bool {
82-
self.eachi(|_i, e| f(e))
83-
}
84-
85-
/// Iterate over the elements in the deque by index
86-
pub fn eachi(&self, f: &fn(uint, &T) -> bool) -> bool {
87-
uint::range(0, self.nelts, |i| f(i, self.get(i as int)))
88-
}
89-
9080
/// Remove and return the first element in the deque
9181
///
9282
/// Fails if the deque is empty
@@ -514,25 +504,6 @@ mod tests {
514504
test_parameterized::<RecCy>(reccy1, reccy2, reccy3, reccy4);
515505
}
516506

517-
#[test]
518-
fn test_eachi() {
519-
let mut deq = Deque::new();
520-
deq.add_back(1);
521-
deq.add_back(2);
522-
deq.add_back(3);
523-
524-
for deq.eachi |i, e| {
525-
assert_eq!(*e, i + 1);
526-
}
527-
528-
deq.pop_front();
529-
530-
for deq.eachi |i, e| {
531-
assert_eq!(*e, i + 2);
532-
}
533-
534-
}
535-
536507
#[test]
537508
fn test_with_capacity() {
538509
let mut d = Deque::with_capacity(0);

branches/try2/src/libextra/serialize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ impl<
682682
> Encodable<S> for Deque<T> {
683683
fn encode(&self, s: &mut S) {
684684
do s.emit_seq(self.len()) |s| {
685-
for self.eachi |i, e| {
685+
for self.iter().enumerate().advance |(i, e)| {
686686
s.emit_seq_elt(i, |s| e.encode(s));
687687
}
688688
}

0 commit comments

Comments
 (0)