mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
Fix build with latest Rust compiler.
This commit is contained in:
parent
3dfafbcc00
commit
8fd1d5a336
2 changed files with 5 additions and 5 deletions
|
@ -182,7 +182,7 @@ fn open(path: ~str) -> Option<~Reader> {
|
|||
return Some(~stdin() as ~Reader);
|
||||
}
|
||||
|
||||
match result(|| File::open(&std::path::Path::new(path.as_slice()))) {
|
||||
match result(|| File::open(&std::path::Path::init(path.as_slice()))) {
|
||||
Ok(fd) => return Some(~fd as ~Reader),
|
||||
Err(e) => {
|
||||
writeln!(&mut stderr() as &mut Writer,
|
||||
|
|
8
wc/wc.rs
8
wc/wc.rs
|
@ -121,12 +121,12 @@ pub fn wc(files: ~[~str], matches: &Matches) {
|
|||
// try and convert the bytes to UTF-8 first
|
||||
match from_utf8_slice_opt(raw_line) {
|
||||
Some(line) => {
|
||||
word_count += line.word_iter().len();
|
||||
current_char_count = line.iter().len();
|
||||
word_count += line.words().len();
|
||||
current_char_count = line.chars().len();
|
||||
char_count += current_char_count;
|
||||
},
|
||||
None => {
|
||||
word_count += raw_line.split_iter(|&x| is_word_seperator(x)).len();
|
||||
word_count += raw_line.split(|&x| is_word_seperator(x)).len();
|
||||
for byte in raw_line.iter() {
|
||||
match byte.is_ascii() {
|
||||
true => {
|
||||
|
@ -221,7 +221,7 @@ fn open(path: ~str) -> Option<BufferedReader<~Reader>> {
|
|||
return Some(BufferedReader::new(reader));
|
||||
}
|
||||
|
||||
match result(|| File::open(&std::path::Path::new(path.as_slice()))) {
|
||||
match result(|| File::open(&std::path::Path::init(path.as_slice()))) {
|
||||
Ok(fd) => {
|
||||
let reader = ~fd as ~Reader;
|
||||
return Some(BufferedReader::new(reader));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue