diff --git a/src/cat/cat.rs b/src/cat/cat.rs index f91862af4..a6b19faf6 100644 --- a/src/cat/cat.rs +++ b/src/cat/cat.rs @@ -284,7 +284,7 @@ fn open(path: &str) -> Option<(Box, bool)> { match File::open(&std::path::Path::new(path)) { Ok(f) => Some((box f as Box, false)), Err(e) => { - (writeln!(stderr(), "cat: {0}: {1}", path, e.to_string())).unwrap(); + (writeln!(&mut stderr(), "cat: {0}: {1}", path, e.to_string())).unwrap(); None }, } diff --git a/src/common/util.rs b/src/common/util.rs index 88e5add24..8531a5aa3 100644 --- a/src/common/util.rs +++ b/src/common/util.rs @@ -88,7 +88,7 @@ macro_rules! return_if_err( #[macro_export] macro_rules! pipe_print( ($($args:expr),+) => ( - match write!(&mut ::std::io::stdout() as &mut Writer, $($args),+) { + match write!(&mut ::std::io::stdout(), $($args),+) { Ok(_) => true, Err(f) => { if f.kind == ::std::io::BrokenPipe { @@ -104,7 +104,7 @@ macro_rules! pipe_print( #[macro_export] macro_rules! pipe_println( ($($args:expr),+) => ( - match writeln!(&mut ::std::io::stdout() as &mut Writer, $($args),+) { + match writeln!(&mut ::std::io::stdout(), $($args),+) { Ok(_) => true, Err(f) => { if f.kind == ::std::io::BrokenPipe { diff --git a/src/env/env.rs b/src/env/env.rs index e5cb91f24..b8c739384 100644 --- a/src/env/env.rs +++ b/src/env/env.rs @@ -181,8 +181,8 @@ pub fn uumain(args: Vec) -> int { } } - for ref name in opts.unsets.iter() { - std::os::unsetenv(name.as_slice()) + for name in opts.unsets.iter() { + std::os::unsetenv((name).as_slice()) } for &(ref name, ref val) in opts.sets.iter() { diff --git a/src/expand/expand.rs b/src/expand/expand.rs index e93d0b5a5..bcaa121fb 100644 --- a/src/expand/expand.rs +++ b/src/expand/expand.rs @@ -139,26 +139,26 @@ fn expand(options: Options) { Ok('\t') if init || !options.iflag => { let nb_spaces = to_next_stop(options.tabstops.as_slice(), col); col += nb_spaces; - safe_write!(output, "{:1$}", "", nb_spaces); + safe_write!(&mut output, "{:1$}", "", nb_spaces); } Ok('\x08') => { if col > 0 { col -= 1; } init = false; - safe_write!(output, "{}", '\x08'); + safe_write!(&mut output, "{}", '\x08'); } Ok('\n') => { col = 0; init = true; - safe_write!(output, "{}", '\n'); + safe_write!(&mut output, "{}", '\n'); } Ok(c) => { col += 1; if c != ' ' { init = false; } - safe_write!(output, "{}", c); + safe_write!(&mut output, "{}", c); } Err(_) => break } diff --git a/src/tty/tty.rs b/src/tty/tty.rs index 03103b554..2c10ba34a 100644 --- a/src/tty/tty.rs +++ b/src/tty/tty.rs @@ -72,5 +72,5 @@ pub fn uumain(args: Vec) -> int { } fn usage () { - safe_writeln!(&mut stderr() as &mut Writer, "usage: tty [-s]"); + safe_writeln!(&mut stderr(), "usage: tty [-s]"); } diff --git a/src/unexpand/unexpand.rs b/src/unexpand/unexpand.rs index 507252f80..8ae3c14a9 100644 --- a/src/unexpand/unexpand.rs +++ b/src/unexpand/unexpand.rs @@ -135,21 +135,21 @@ fn to_next_stop(tabstops: &[uint], col: uint) -> Option { } } -fn unexpandspan(output: &mut io::LineBufferedWriter, +fn unexpandspan(mut output: &mut io::LineBufferedWriter, tabstops: &[uint], nspaces: uint, col: uint, init: bool) { let mut cur = col - nspaces; if nspaces > 1 || init { loop { match to_next_stop(tabstops, cur) { Some(to_next) if cur + to_next <= col => { - safe_write!(output, "{}", '\t'); + safe_write!(&mut output, "{}", '\t'); cur += to_next; } _ => break } } } - safe_write!(output, "{:1$}", "", col - cur); + safe_write!(&mut output, "{:1$}", "", col - cur); } fn unexpand(options: Options) { @@ -167,7 +167,7 @@ fn unexpand(options: Options) { nspaces += 1; } else { nspaces = 0; - safe_write!(output, "{}", ' '); + safe_write!(&mut output, "{}", ' '); } col += 1; } @@ -175,7 +175,7 @@ fn unexpand(options: Options) { if is_tabstop(ts, col) { nspaces = 0; col += 1; - safe_write!(output, "{}", '\t'); + safe_write!(&mut output, "{}", '\t'); } match to_next_stop(ts, col) { Some(to_next) => { @@ -186,7 +186,7 @@ fn unexpand(options: Options) { col += 1; unexpandspan(&mut output, ts, nspaces, col, init); nspaces = 0; - safe_write!(output, "{}", '\t'); + safe_write!(&mut output, "{}", '\t'); } } } @@ -197,7 +197,7 @@ fn unexpand(options: Options) { nspaces = 0; if col > 0 { col -= 1; } init = false; - safe_write!(output, "{}", '\x08'); + safe_write!(&mut output, "{}", '\x08'); } Ok('\n') => { if init || options.aflag { @@ -206,7 +206,7 @@ fn unexpand(options: Options) { nspaces = 0; col = 0; init = true; - safe_write!(output, "{}", '\n'); + safe_write!(&mut output, "{}", '\n'); } Ok(c) => { if init || options.aflag { @@ -215,7 +215,7 @@ fn unexpand(options: Options) { nspaces = 0; col += 1; init = false; - safe_write!(output, "{}", c); + safe_write!(&mut output, "{}", c); } Err(_) => break }