about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorYoungmin Yoo <youngmin.yoo@samsung.com>2013-05-08 16:23:14 +0900
committerYoungmin Yoo <youngmin.yoo@samsung.com>2013-05-09 14:17:18 +0900
commit9a292b3da5585f0230ed5d0e198531b87633b832 (patch)
treebdbab0e599fb96e7439c78dc8f343ee139c05508 /src
parent3bbbb314ee61aa00deb3e9756421fd2465fd7a91 (diff)
libcore: rename vec::each(variable) to variable.each
Diffstat (limited to 'src')
-rw-r--r--src/libcore/at_vec.rs4
-rw-r--r--src/libcore/either.rs4
-rw-r--r--src/libcore/hash.rs4
-rw-r--r--src/libcore/io.rs2
-rw-r--r--src/libcore/os.rs4
-rw-r--r--src/libcore/result.rs2
-rw-r--r--src/libcore/run.rs6
-rw-r--r--src/libcore/str.rs8
8 files changed, 17 insertions, 17 deletions
diff --git a/src/libcore/at_vec.rs b/src/libcore/at_vec.rs
index aa20c1556ed..a6306c33eb9 100644
--- a/src/libcore/at_vec.rs
+++ b/src/libcore/at_vec.rs
@@ -102,7 +102,7 @@ pub fn build_sized_opt<A>(size: Option<uint>,
 #[inline(always)]
 pub fn append<T:Copy>(lhs: @[T], rhs: &const [T]) -> @[T] {
     do build_sized(lhs.len() + rhs.len()) |push| {
-        for vec::each(lhs) |x| { push(*x); }
+        for lhs.each |x| { push(*x); }
         for uint::range(0, rhs.len()) |i| { push(rhs[i]); }
     }
 }
@@ -111,7 +111,7 @@ pub fn append<T:Copy>(lhs: @[T], rhs: &const [T]) -> @[T] {
 /// Apply a function to each element of a vector and return the results
 pub fn map<T, U>(v: &[T], f: &fn(x: &T) -> U) -> @[U] {
     do build_sized(v.len()) |push| {
-        for vec::each(v) |elem| {
+        for v.each |elem| {
             push(f(elem));
         }
     }
diff --git a/src/libcore/either.rs b/src/libcore/either.rs
index 33b7e81ee85..957e848b5e7 100644
--- a/src/libcore/either.rs
+++ b/src/libcore/either.rs
@@ -44,7 +44,7 @@ pub fn lefts<T:Copy,U>(eithers: &[Either<T, U>]) -> ~[T] {
     //! Extracts from a vector of either all the left values
 
     do vec::build_sized(eithers.len()) |push| {
-        for vec::each(eithers) |elt| {
+        for eithers.each |elt| {
             match *elt {
                 Left(ref l) => { push(*l); }
                 _ => { /* fallthrough */ }
@@ -57,7 +57,7 @@ pub fn rights<T, U: Copy>(eithers: &[Either<T, U>]) -> ~[U] {
     //! Extracts from a vector of either all the right values
 
     do vec::build_sized(eithers.len()) |push| {
-        for vec::each(eithers) |elt| {
+        for eithers.each |elt| {
             match *elt {
                 Right(ref r) => { push(*r); }
                 _ => { /* fallthrough */ }
diff --git a/src/libcore/hash.rs b/src/libcore/hash.rs
index d535abf8ead..e00fb33fad9 100644
--- a/src/libcore/hash.rs
+++ b/src/libcore/hash.rs
@@ -378,7 +378,7 @@ impl Streaming for SipState {
     fn result_str(&mut self) -> ~str {
         let r = self.result_bytes();
         let mut s = ~"";
-        for vec::each(r) |b| {
+        for r.each |b| {
             s += uint::to_str_radix(*b as uint, 16u);
         }
         s
@@ -478,7 +478,7 @@ mod tests {
 
         fn to_hex_str(r: &[u8, ..8]) -> ~str {
             let mut s = ~"";
-            for vec::each(*r) |b| {
+            for (*r).each |b| {
                 s += uint::to_str_radix(*b as uint, 16u);
             }
             s
diff --git a/src/libcore/io.rs b/src/libcore/io.rs
index 1bb754fc2be..7fc2c2559c2 100644
--- a/src/libcore/io.rs
+++ b/src/libcore/io.rs
@@ -1200,7 +1200,7 @@ pub fn mk_file_writer(path: &Path, flags: &[FileFlag])
     fn wb() -> c_int { O_WRONLY as c_int }
 
     let mut fflags: c_int = wb();
-    for vec::each(flags) |f| {
+    for flags.each |f| {
         match *f {
           Append => fflags |= O_APPEND as c_int,
           Create => fflags |= O_CREAT as c_int,
diff --git a/src/libcore/os.rs b/src/libcore/os.rs
index afb96414858..574618026d9 100644
--- a/src/libcore/os.rs
+++ b/src/libcore/os.rs
@@ -1491,7 +1491,7 @@ mod tests {
     fn test_env_getenv() {
         let e = env();
         assert!(vec::len(e) > 0u);
-        for vec::each(e) |p| {
+        for e.each |p| {
             let (n, v) = copy *p;
             debug!(copy n);
             let v2 = getenv(n);
@@ -1583,7 +1583,7 @@ mod tests {
         // Just assuming that we've got some contents in the current directory
         assert!((vec::len(dirs) > 0u));
 
-        for vec::each(dirs) |dir| {
+        for dirs.each |dir| {
             debug!(copy *dir);
         }
     }
diff --git a/src/libcore/result.rs b/src/libcore/result.rs
index 17cc07c660d..1d67e754a4f 100644
--- a/src/libcore/result.rs
+++ b/src/libcore/result.rs
@@ -300,7 +300,7 @@ pub fn map_vec<T,U:Copy,V:Copy>(
     ts: &[T], op: &fn(&T) -> Result<V,U>) -> Result<~[V],U> {
 
     let mut vs: ~[V] = vec::with_capacity(vec::len(ts));
-    for vec::each(ts) |t| {
+    for ts.each |t| {
         match op(t) {
           Ok(copy v) => vs.push(v),
           Err(copy u) => return Err(u)
diff --git a/src/libcore/run.rs b/src/libcore/run.rs
index 55b6c5100dd..fd168dc02f6 100644
--- a/src/libcore/run.rs
+++ b/src/libcore/run.rs
@@ -426,7 +426,7 @@ fn with_argv<T>(prog: &str, args: &[~str],
                 cb: &fn(**libc::c_char) -> T) -> T {
     let mut argptrs = str::as_c_str(prog, |b| ~[b]);
     let mut tmps = ~[];
-    for vec::each(args) |arg| {
+    for args.each |arg| {
         let t = @copy *arg;
         tmps.push(t);
         argptrs.push_all(str::as_c_str(*t, |b| ~[b]));
@@ -445,7 +445,7 @@ fn with_envp<T>(env: &Option<~[(~str,~str)]>,
         let mut tmps = ~[];
         let mut ptrs = ~[];
 
-        for vec::each(*es) |e| {
+        for (*es).each |e| {
             let (k,v) = copy *e;
             let t = @(fmt!("%s=%s", k, v));
             tmps.push(t);
@@ -470,7 +470,7 @@ fn with_envp<T>(env: &Option<~[(~str,~str)]>,
         match *env {
           Some(ref es) if !vec::is_empty(*es) => {
             let mut blk : ~[u8] = ~[];
-            for vec::each(*es) |e| {
+            for (*es).each |e| {
                 let (k,v) = copy *e;
                 let t = fmt!("%s=%s", k, v);
                 let mut v : ~[u8] = ::cast::transmute(t);
diff --git a/src/libcore/str.rs b/src/libcore/str.rs
index 44c07e86814..5ec6471ac4a 100644
--- a/src/libcore/str.rs
+++ b/src/libcore/str.rs
@@ -189,7 +189,7 @@ pub fn from_char(ch: char) -> ~str {
 pub fn from_chars(chs: &[char]) -> ~str {
     let mut buf = ~"";
     reserve(&mut buf, chs.len());
-    for vec::each(chs) |ch| {
+    for chs.each |ch| {
         push_char(&mut buf, *ch);
     }
     buf
@@ -326,7 +326,7 @@ pub fn connect_slices(v: &[&str], sep: &str) -> ~str {
             do as_buf(sep) |sepbuf, seplen| {
                 let seplen = seplen - 1;
                 let mut buf = ::cast::transmute_mut_unsafe(buf);
-                for vec::each(v) |ss| {
+                for v.each |ss| {
                     do as_buf(*ss) |ssbuf, sslen| {
                         let sslen = sslen - 1;
                         if first {
@@ -2407,7 +2407,7 @@ pub mod raw {
     unsafe fn push_bytes(s: &mut ~str, bytes: &[u8]) {
         let new_len = s.len() + bytes.len();
         reserve_at_least(&mut *s, new_len);
-        for vec::each(bytes) |byte| { push_byte(&mut *s, *byte); }
+        for bytes.each |byte| { push_byte(&mut *s, *byte); }
     }
 
     /// Removes the last byte from a string and returns it. (Not UTF-8 safe).
@@ -3782,7 +3782,7 @@ mod tests {
                0xd801_u16, 0xdc95_u16, 0xd801_u16, 0xdc86_u16,
                0x000a_u16 ]) ];
 
-        for vec::each(pairs) |p| {
+        for pairs.each |p| {
             let (s, u) = copy *p;
             assert!(to_utf16(s) == u);
             assert!(from_utf16(u) == s);