From fe48a65aaa8e8c218b42ccd67a91c903935ac9e5 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Tue, 9 Dec 2014 12:09:31 -0500 Subject: libstd: use tuple indexing --- src/libstd/sys/unix/process.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/libstd/sys') diff --git a/src/libstd/sys/unix/process.rs b/src/libstd/sys/unix/process.rs index 7dde19a6476..dfbba0f335c 100644 --- a/src/libstd/sys/unix/process.rs +++ b/src/libstd/sys/unix/process.rs @@ -379,8 +379,8 @@ impl Process { // wait indefinitely for a message to arrive. // // FIXME: sure would be nice to not have to scan the entire array - let min = active.iter().map(|a| *a.ref2()).enumerate().min_by(|p| { - p.val1() + let min = active.iter().map(|a| a.2).enumerate().min_by(|p| { + p.1 }); let (p, idx) = match min { Some((idx, deadline)) => { @@ -564,9 +564,9 @@ fn with_envp(env: Option<&collections::HashMap>, for pair in env.iter() { let mut kv = Vec::new(); - kv.push_all(pair.ref0().container_as_bytes()); + kv.push_all(pair.0.container_as_bytes()); kv.push('=' as u8); - kv.push_all(pair.ref1().container_as_bytes()); + kv.push_all(pair.1.container_as_bytes()); kv.push(0); // terminating null tmps.push(kv); } -- cgit 1.4.1-3-g733a5 From 029789b98cf0115f347fe12fd19bd2c29751f8ce Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Sat, 13 Dec 2014 10:04:55 -0500 Subject: Get rid of all the remaining uses of `refN`/`valN`/`mutN`/`TupleN` --- src/etc/unicode.py | 5 ++--- src/libstd/sys/windows/process.rs | 4 ++-- src/test/bench/shootout-fasta.rs | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'src/libstd/sys') diff --git a/src/etc/unicode.py b/src/etc/unicode.py index c41c26a1ccb..257cd802582 100755 --- a/src/etc/unicode.py +++ b/src/etc/unicode.py @@ -348,7 +348,6 @@ def emit_conversions_module(f, lowerupper, upperlower): f.write(""" use core::cmp::Ordering::{Equal, Less, Greater}; use core::slice::SlicePrelude; - use core::tuple::Tuple2; use core::option::Option; use core::option::Option::{Some, None}; use core::slice; @@ -356,14 +355,14 @@ def emit_conversions_module(f, lowerupper, upperlower): pub fn to_lower(c: char) -> char { match bsearch_case_table(c, LuLl_table) { None => c, - Some(index) => LuLl_table[index].val1() + Some(index) => LuLl_table[index].1 } } pub fn to_upper(c: char) -> char { match bsearch_case_table(c, LlLu_table) { None => c, - Some(index) => LlLu_table[index].val1() + Some(index) => LlLu_table[index].1 } } diff --git a/src/libstd/sys/windows/process.rs b/src/libstd/sys/windows/process.rs index 356d6f02565..bbfd32ee76b 100644 --- a/src/libstd/sys/windows/process.rs +++ b/src/libstd/sys/windows/process.rs @@ -430,8 +430,8 @@ fn with_envp(env: Option<&collections::HashMap>, cb: F) -> T w for pair in env.iter() { let kv = format!("{}={}", - pair.ref0().container_as_str().unwrap(), - pair.ref1().container_as_str().unwrap()); + pair.0.container_as_str().unwrap(), + pair.1.container_as_str().unwrap()); blk.extend(kv.utf16_units()); blk.push(0); } diff --git a/src/test/bench/shootout-fasta.rs b/src/test/bench/shootout-fasta.rs index f9fafa977ac..1f0bed05521 100644 --- a/src/test/bench/shootout-fasta.rs +++ b/src/test/bench/shootout-fasta.rs @@ -78,7 +78,7 @@ impl<'a> Iterator for AAGen<'a> { fn next(&mut self) -> Option { let r = self.rng.gen(); self.data.iter() - .skip_while(|pc| pc.val0() < r) + .skip_while(|pc| pc.0 < r) .map(|&(_, c)| c) .next() } -- cgit 1.4.1-3-g733a5