about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorErick Tryzelaar <erick.tryzelaar@gmail.com>2013-08-09 20:49:29 -0700
committerErick Tryzelaar <erick.tryzelaar@gmail.com>2013-08-10 07:33:22 -0700
commit6fcf2ee8e341c594fe9b9c148e13a4cb8ce6b4a3 (patch)
treeae1cb03b1b91aa2a2baa1a24317952d1c78dbc62 /src/libstd
parentf9dee04aaabc0ee38f91744e07fe67f36ec6c8e9 (diff)
downloadrust-6fcf2ee8e341c594fe9b9c148e13a4cb8ce6b4a3.tar.gz
rust-6fcf2ee8e341c594fe9b9c148e13a4cb8ce6b4a3.zip
std: Transform.find_ -> .find
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/iterator.rs8
-rw-r--r--src/libstd/str.rs4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/libstd/iterator.rs b/src/libstd/iterator.rs
index dc9550f6e4d..a7a1c0bede8 100644
--- a/src/libstd/iterator.rs
+++ b/src/libstd/iterator.rs
@@ -458,7 +458,7 @@ pub trait Iterator<A> {
 
     /// Return the first element satisfying the specified predicate
     #[inline]
-    fn find_(&mut self, predicate: &fn(&A) -> bool) -> Option<A> {
+    fn find(&mut self, predicate: &fn(&A) -> bool) -> Option<A> {
         for x in *self {
             if predicate(&x) { return Some(x) }
         }
@@ -1819,9 +1819,9 @@ mod tests {
     #[test]
     fn test_find() {
         let v: &[int] = &[1, 3, 9, 27, 103, 14, 11];
-        assert_eq!(*v.iter().find_(|x| *x & 1 == 0).unwrap(), 14);
-        assert_eq!(*v.iter().find_(|x| *x % 3 == 0).unwrap(), 3);
-        assert!(v.iter().find_(|x| *x % 12 == 0).is_none());
+        assert_eq!(*v.iter().find(|x| *x & 1 == 0).unwrap(), 14);
+        assert_eq!(*v.iter().find(|x| *x % 3 == 0).unwrap(), 3);
+        assert!(v.iter().find(|x| *x % 12 == 0).is_none());
     }
 
     #[test]
diff --git a/src/libstd/str.rs b/src/libstd/str.rs
index df71a6f054a..820c344f739 100644
--- a/src/libstd/str.rs
+++ b/src/libstd/str.rs
@@ -59,7 +59,7 @@ pub fn from_bytes(vv: &[u8]) -> ~str {
     use str::not_utf8::cond;
 
     if !is_utf8(vv) {
-        let first_bad_byte = *vv.iter().find_(|&b| !is_utf8([*b])).unwrap();
+        let first_bad_byte = *vv.iter().find(|&b| !is_utf8([*b])).unwrap();
         cond.raise(fmt!("from_bytes: input is not UTF-8; first bad byte is %u",
                         first_bad_byte as uint))
     } else {
@@ -76,7 +76,7 @@ pub fn from_bytes_owned(vv: ~[u8]) -> ~str {
     use str::not_utf8::cond;
 
     if !is_utf8(vv) {
-        let first_bad_byte = *vv.iter().find_(|&b| !is_utf8([*b])).unwrap();
+        let first_bad_byte = *vv.iter().find(|&b| !is_utf8([*b])).unwrap();
         cond.raise(fmt!("from_bytes: input is not UTF-8; first bad byte is %u",
                         first_bad_byte as uint))
     } else {