mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-31 21:17:46 +00:00
Fix build with rust nightly Dec-20-2014
This commit is contained in:
parent
8cb5d03d0c
commit
75425f1fe8
4 changed files with 11 additions and 6 deletions
|
@ -62,7 +62,8 @@ fn paste(filenames: Vec<String>, serial: bool, delimiters: &str) {
|
|||
if name.as_slice() == "-" {
|
||||
box io::stdio::stdin_raw() as Box<Reader>
|
||||
} else {
|
||||
box crash_if_err!(1, io::File::open(&Path::new(name))) as Box<Reader>
|
||||
let r = crash_if_err!(1, io::File::open(&Path::new(name)));
|
||||
box r as Box<Reader>
|
||||
}
|
||||
)
|
||||
).collect();
|
||||
|
|
|
@ -221,10 +221,11 @@ fn split(settings: &Settings) -> int {
|
|||
if settings.input.as_slice() == "-" {
|
||||
box io::stdio::stdin_raw() as Box<Reader>
|
||||
} else {
|
||||
box match io::File::open(&Path::new(settings.input.clone())) {
|
||||
let r = match io::File::open(&Path::new(settings.input.clone())) {
|
||||
Ok(a) => a,
|
||||
Err(_) => crash!(1, "cannot open '{}' for reading: No such file or directory", settings.input)
|
||||
} as Box<Reader>
|
||||
};
|
||||
box r as Box<Reader>
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -75,7 +75,8 @@ fn tac(filenames: Vec<String>, before: bool, _: bool, separator: &str) {
|
|||
if filename.as_slice() == "-" {
|
||||
box io::stdio::stdin_raw() as Box<Reader>
|
||||
} else {
|
||||
box crash_if_err!(1, io::File::open(&Path::new(filename))) as Box<Reader>
|
||||
let r = crash_if_err!(1, io::File::open(&Path::new(filename)));
|
||||
box r as Box<Reader>
|
||||
}
|
||||
);
|
||||
let mut data = crash_if_err!(1, file.read_to_string());
|
||||
|
|
|
@ -196,7 +196,8 @@ fn open_input_file(in_file_name: String) -> io::BufferedReader<Box<Reader+'stati
|
|||
} else {
|
||||
let path = Path::new(in_file_name);
|
||||
let in_file = io::File::open(&path);
|
||||
box crash_if_err!(1, in_file) as Box<Reader>
|
||||
let r = crash_if_err!(1, in_file);
|
||||
box r as Box<Reader>
|
||||
};
|
||||
io::BufferedReader::new(in_file)
|
||||
}
|
||||
|
@ -207,7 +208,8 @@ fn open_output_file(out_file_name: String) -> io::BufferedWriter<Box<Writer+'sta
|
|||
} else {
|
||||
let path = Path::new(out_file_name);
|
||||
let in_file = io::File::create(&path);
|
||||
box crash_if_err!(1, in_file) as Box<Writer>
|
||||
let w = crash_if_err!(1, in_file);
|
||||
box w as Box<Writer>
|
||||
};
|
||||
io::BufferedWriter::new(out_file)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue