about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorErick Tryzelaar <erick.tryzelaar@gmail.com>2013-08-09 20:30:03 -0700
committerErick Tryzelaar <erick.tryzelaar@gmail.com>2013-08-10 07:33:22 -0700
commitf9dee04aaabc0ee38f91744e07fe67f36ec6c8e9 (patch)
tree8f4c820450000fe20dc036db485afed156e9e0a9 /src
parent74d2552b0ab671a7455b5a60972c0cc6e3ecdb82 (diff)
downloadrust-f9dee04aaabc0ee38f91744e07fe67f36ec6c8e9.tar.gz
rust-f9dee04aaabc0ee38f91744e07fe67f36ec6c8e9.zip
std: Iterator.len_ -> .len
Diffstat (limited to 'src')
-rw-r--r--src/compiletest/runtest.rs2
-rw-r--r--src/libextra/dlist.rs8
-rw-r--r--src/librustpkg/version.rs4
-rw-r--r--src/libstd/iterator.rs13
-rw-r--r--src/libstd/str.rs2
5 files changed, 14 insertions, 15 deletions
diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs
index d325341d157..0fb64152d37 100644
--- a/src/compiletest/runtest.rs
+++ b/src/compiletest/runtest.rs
@@ -938,7 +938,7 @@ fn disassemble_extract(config: &config, _props: &TestProps,
 
 fn count_extracted_lines(p: &Path) -> uint {
     let x = io::read_whole_file_str(&p.with_filetype("ll")).unwrap();
-    x.line_iter().len_()
+    x.line_iter().len()
 }
 
 
diff --git a/src/libextra/dlist.rs b/src/libextra/dlist.rs
index 3e1038b2b4e..19a72b0029f 100644
--- a/src/libextra/dlist.rs
+++ b/src/libextra/dlist.rs
@@ -1077,7 +1077,7 @@ mod tests {
         let v = &[0, ..128];
         let m: DList<int> = v.iter().map(|&x|x).collect();
         do b.iter {
-            assert!(m.iter().len_() == 128);
+            assert!(m.iter().len() == 128);
         }
     }
     #[bench]
@@ -1085,7 +1085,7 @@ mod tests {
         let v = &[0, ..128];
         let mut m: DList<int> = v.iter().map(|&x|x).collect();
         do b.iter {
-            assert!(m.mut_iter().len_() == 128);
+            assert!(m.mut_iter().len() == 128);
         }
     }
     #[bench]
@@ -1093,7 +1093,7 @@ mod tests {
         let v = &[0, ..128];
         let m: DList<int> = v.iter().map(|&x|x).collect();
         do b.iter {
-            assert!(m.rev_iter().len_() == 128);
+            assert!(m.rev_iter().len() == 128);
         }
     }
     #[bench]
@@ -1101,7 +1101,7 @@ mod tests {
         let v = &[0, ..128];
         let mut m: DList<int> = v.iter().map(|&x|x).collect();
         do b.iter {
-            assert!(m.mut_rev_iter().len_() == 128);
+            assert!(m.mut_rev_iter().len() == 128);
         }
     }
 }
diff --git a/src/librustpkg/version.rs b/src/librustpkg/version.rs
index ab4f47ba69a..44cb8065b38 100644
--- a/src/librustpkg/version.rs
+++ b/src/librustpkg/version.rs
@@ -200,7 +200,7 @@ fn try_parsing_version(s: &str) -> Option<Version> {
 /// Just an approximation
 fn is_url_like(p: &Path) -> bool {
     let str = p.to_str();
-    str.split_iter('/').len_() > 2
+    str.split_iter('/').len() > 2
 }
 
 /// If s is of the form foo#bar, where bar is a valid version
@@ -215,7 +215,7 @@ pub fn split_version_general<'a>(s: &'a str, sep: char) -> Option<(&'a str, Vers
     for st in s.split_iter(sep) {
         debug!("whole = %s part = %s", s, st);
     }
-    if s.split_iter(sep).len_() > 2 {
+    if s.split_iter(sep).len() > 2 {
         return None;
     }
     match s.rfind(sep) {
diff --git a/src/libstd/iterator.rs b/src/libstd/iterator.rs
index 811adb53cb4..dc9550f6e4d 100644
--- a/src/libstd/iterator.rs
+++ b/src/libstd/iterator.rs
@@ -409,7 +409,6 @@ pub trait Iterator<A> {
         accum
     }
 
-    // FIXME: #5898: should be called len
     /// Counts the number of elements in this iterator.
     ///
     /// # Example
@@ -417,11 +416,11 @@ pub trait Iterator<A> {
     /// ~~~ {.rust}
     /// let a = [1, 2, 3, 4, 5];
     /// let mut it = a.iter();
-    /// assert!(it.len_() == 5);
-    /// assert!(it.len_() == 0);
+    /// assert!(it.len() == 5);
+    /// assert!(it.len() == 0);
     /// ~~~
     #[inline]
-    fn len_(&mut self) -> uint {
+    fn len(&mut self) -> uint {
         self.fold(0, |cnt, _x| cnt + 1)
     }
 
@@ -1718,9 +1717,9 @@ mod tests {
     #[test]
     fn test_iterator_len() {
         let v = &[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
-        assert_eq!(v.slice(0, 4).iter().len_(), 4);
-        assert_eq!(v.slice(0, 10).iter().len_(), 10);
-        assert_eq!(v.slice(0, 0).iter().len_(), 0);
+        assert_eq!(v.slice(0, 4).iter().len(), 4);
+        assert_eq!(v.slice(0, 10).iter().len(), 10);
+        assert_eq!(v.slice(0, 0).iter().len(), 0);
     }
 
     #[test]
diff --git a/src/libstd/str.rs b/src/libstd/str.rs
index b2c0b5a4fb2..df71a6f054a 100644
--- a/src/libstd/str.rs
+++ b/src/libstd/str.rs
@@ -1593,7 +1593,7 @@ impl<'self> StrSlice<'self> for &'self str {
 
     /// Returns the number of characters that a string holds
     #[inline]
-    fn char_len(&self) -> uint { self.iter().len_() }
+    fn char_len(&self) -> uint { self.iter().len() }
 
     /// Returns a slice of the given string from the byte range
     /// [`begin`..`end`)