for x in xs.iter() -> for x in &xs

This commit is contained in:
Jorge Aparicio
2015-01-31 12:20:46 -05:00
parent 9f90d666e0
commit d5d7e6565a
269 changed files with 1063 additions and 1064 deletions

View File

@@ -400,7 +400,7 @@ impl fmt::Debug for Command {
/// character.
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
try!(write!(f, "{:?}", self.program));
for arg in self.args.iter() {
for arg in &self.args {
try!(write!(f, " '{:?}'", arg));
}
Ok(())
@@ -1045,7 +1045,7 @@ mod tests {
let output = String::from_utf8(prog.wait_with_output().unwrap().output).unwrap();
let r = os::env();
for &(ref k, ref v) in r.iter() {
for &(ref k, ref v) in &r {
// don't check windows magical empty-named variables
assert!(k.is_empty() ||
output.contains(format!("{}={}", *k, *v).as_slice()),
@@ -1063,7 +1063,7 @@ mod tests {
let output = String::from_utf8(prog.wait_with_output().unwrap().output).unwrap();
let r = os::env();
for &(ref k, ref v) in r.iter() {
for &(ref k, ref v) in &r {
// don't check android RANDOM variables
if *k != "RANDOM".to_string() {
assert!(output.contains(format!("{}={}",