about summary refs log tree commit diff
path: root/src/libcoretest
diff options
context:
space:
mode:
authorAaron Turon <aturon@mozilla.com>2015-03-13 11:35:53 -0700
committerAaron Turon <aturon@mozilla.com>2015-03-13 14:45:13 -0700
commit1d5983aded687149239e8943debd51abdce5d27b (patch)
tree0ff9089b7e510e8d93c0c18e775ed315141d3b82 /src/libcoretest
parentee7696383f3423cdd17373ff9e75c01acd8e3417 (diff)
downloadrust-1d5983aded687149239e8943debd51abdce5d27b.tar.gz
rust-1d5983aded687149239e8943debd51abdce5d27b.zip
Deprecate range, range_step, count, distributions
This commit deprecates the `count`, `range` and `range_step` functions
in `iter`, in favor of range notation. To recover all existing
functionality, a new `step_by` adapter is provided directly on `ops::Range`
and `ops::RangeFrom`.

[breaking-change]
Diffstat (limited to 'src/libcoretest')
-rw-r--r--src/libcoretest/iter.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libcoretest/iter.rs b/src/libcoretest/iter.rs
index 0f4e7fcdda5..52cc2519add 100644
--- a/src/libcoretest/iter.rs
+++ b/src/libcoretest/iter.rs
@@ -775,12 +775,12 @@ fn test_range_inclusive() {
 
 #[test]
 fn test_range_step() {
-    assert_eq!(range_step(0, 20, 5).collect::<Vec<int>>(), [0, 5, 10, 15]);
-    assert_eq!(range_step(20, 0, -5).collect::<Vec<int>>(), [20, 15, 10, 5]);
-    assert_eq!(range_step(20, 0, -6).collect::<Vec<int>>(), [20, 14, 8, 2]);
-    assert_eq!(range_step(200, 255, 50).collect::<Vec<u8>>(), [200, 250]);
-    assert_eq!(range_step(200, -5, 1).collect::<Vec<int>>(), []);
-    assert_eq!(range_step(200, 200, 1).collect::<Vec<int>>(), []);
+    assert_eq!((0..20).step_by(5).collect::<Vec<int>>(), [0, 5, 10, 15]);
+    assert_eq!((20..0).step_by(-5).collect::<Vec<int>>(), [20, 15, 10, 5]);
+    assert_eq!((20..0).step_by(-6).collect::<Vec<int>>(), [20, 14, 8, 2]);
+    assert_eq!((200..255).step_by(50).collect::<Vec<u8>>(), [200, 250]);
+    assert_eq!((200..-5).step_by(1).collect::<Vec<int>>(), []);
+    assert_eq!((200..200).step_by(1).collect::<Vec<int>>(), []);
 }
 
 #[test]