From c223e28fac64a7d367db6c28a17bc72d4fedfc23 Mon Sep 17 00:00:00 2001 From: Michael Gehring Date: Sat, 10 Jan 2015 13:49:40 +0100 Subject: [PATCH] uniq, wc: fix build --- src/uniq/uniq.rs | 8 ++++---- src/wc/wc.rs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/uniq/uniq.rs b/src/uniq/uniq.rs index dc6b96953..2560c27ac 100644 --- a/src/uniq/uniq.rs +++ b/src/uniq/uniq.rs @@ -191,24 +191,24 @@ pub fn uumain(args: Vec) -> int { fn open_input_file(in_file_name: String) -> io::BufferedReader> { let in_file = if in_file_name.as_slice() == "-" { - box io::stdio::stdin_raw() as Box + Box::new(io::stdio::stdin_raw()) as Box } else { let path = Path::new(in_file_name); let in_file = io::File::open(&path); let r = crash_if_err!(1, in_file); - box r as Box + Box::new(r) as Box }; io::BufferedReader::new(in_file) } fn open_output_file(out_file_name: String) -> io::BufferedWriter> { let out_file = if out_file_name.as_slice() == "-" { - box io::stdio::stdout_raw() as Box + Box::new(io::stdio::stdout_raw()) as Box } else { let path = Path::new(out_file_name); let in_file = io::File::create(&path); let w = crash_if_err!(1, in_file); - box w as Box + Box::new(w) as Box }; io::BufferedWriter::new(out_file) } diff --git a/src/wc/wc.rs b/src/wc/wc.rs index 75f20d347..9c041f180 100644 --- a/src/wc/wc.rs +++ b/src/wc/wc.rs @@ -230,7 +230,7 @@ fn print_stats(filename: &str, line_count: uint, word_count: uint, char_count: u fn open(path: &str) -> StdResult>, int> { if "-" == path { - let reader = box stdin_raw() as Box; + let reader = Box::new(stdin_raw()) as Box; return Ok(BufferedReader::new(reader)); } @@ -240,7 +240,7 @@ fn open(path: &str) -> StdResult>, int> { } match File::open(&fpath) { Ok(fd) => { - let reader = box fd as Box; + let reader = Box::new(fd) as Box; Ok(BufferedReader::new(reader)) } Err(e) => {