Skip to content

Commit 6564949

Browse files
artagnonemberian
authored andcommitted
---
yaml --- r: 63709 b: refs/heads/snap-stage3 c: 41f953a h: refs/heads/master i: 63707: cfe9167 v: v3
1 parent 2d1a801 commit 6564949

File tree

3 files changed

+3
-63
lines changed

3 files changed

+3
-63
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 8edb8f6d39498476f1124ce1bb5bb4e094bde43f
4+
refs/heads/snap-stage3: 41f953af2ee86e4bda1025d77dc8525f42bc7a69
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/.gitmodules

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
[submodule "src/llvm"]
22
path = src/llvm
33
url = https://github.com/brson/llvm.git
4+
branch = master
45
[submodule "src/libuv"]
56
path = src/libuv
67
url = https://github.com/brson/libuv.git
8+
branch = master

branches/snap-stage3/src/libstd/iterator.rs

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -351,26 +351,6 @@ pub trait IteratorUtil<A> {
351351

352352
/// Count the number of elements satisfying the specified predicate
353353
fn count(&mut self, predicate: &fn(A) -> bool) -> uint;
354-
355-
/// Return the element that gives the maximum value from the specfied function
356-
///
357-
/// # Example
358-
///
359-
/// --- {.rust}
360-
/// let xs = [-3, 0, 1, 5, -10];
361-
/// assert_eq!(*xs.iter().max_by(|x| x.abs()).unwrap(), -10);
362-
/// ---
363-
fn max_by<B: Ord>(&mut self, f: &fn(&A) -> B) -> Option<A>;
364-
365-
/// Return the element that gives the minimum value from the specfied function
366-
///
367-
/// # Example
368-
///
369-
/// --- {.rust}
370-
/// let xs = [-3, 0, 1, 5, -10];
371-
/// assert_eq!(*xs.iter().min_by(|x| x.abs()).unwrap(), 0);
372-
/// ---
373-
fn min_by<B: Ord>(&mut self, f: &fn(&A) -> B) -> Option<A>;
374354
}
375355

376356
/// Iterator adaptors provided for every `Iterator` implementation. The adaptor objects are also
@@ -539,36 +519,6 @@ impl<A, T: Iterator<A>> IteratorUtil<A> for T {
539519
}
540520
i
541521
}
542-
543-
#[inline]
544-
fn max_by<B: Ord>(&mut self, f: &fn(&A) -> B) -> Option<A> {
545-
self.fold(None, |max: Option<(A, B)>, x| {
546-
let x_val = f(&x);
547-
match max {
548-
None => Some((x, x_val)),
549-
Some((y, y_val)) => if x_val > y_val {
550-
Some((x, x_val))
551-
} else {
552-
Some((y, y_val))
553-
}
554-
}
555-
}).map_consume(|(x, _)| x)
556-
}
557-
558-
#[inline]
559-
fn min_by<B: Ord>(&mut self, f: &fn(&A) -> B) -> Option<A> {
560-
self.fold(None, |min: Option<(A, B)>, x| {
561-
let x_val = f(&x);
562-
match min {
563-
None => Some((x, x_val)),
564-
Some((y, y_val)) => if x_val < y_val {
565-
Some((x, x_val))
566-
} else {
567-
Some((y, y_val))
568-
}
569-
}
570-
}).map_consume(|(x, _)| x)
571-
}
572522
}
573523

574524
/// A trait for iterators over elements which can be added together
@@ -1287,16 +1237,4 @@ mod tests {
12871237
assert_eq!(xs.iter().count(|x| *x == 5), 1);
12881238
assert_eq!(xs.iter().count(|x| *x == 95), 0);
12891239
}
1290-
1291-
#[test]
1292-
fn test_max_by() {
1293-
let xs = [-3, 0, 1, 5, -10];
1294-
assert_eq!(*xs.iter().max_by(|x| x.abs()).unwrap(), -10);
1295-
}
1296-
1297-
#[test]
1298-
fn test_min_by() {
1299-
let xs = [-3, 0, 1, 5, -10];
1300-
assert_eq!(*xs.iter().min_by(|x| x.abs()).unwrap(), 0);
1301-
}
13021240
}

0 commit comments

Comments
 (0)