mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
wc: fix build with rust master
This commit is contained in:
parent
8b64287202
commit
c5c6362782
1 changed files with 3 additions and 3 deletions
6
wc/wc.rs
6
wc/wc.rs
|
@ -127,12 +127,12 @@ pub fn wc(files: Vec<String>, matches: &Matches) {
|
||||||
// try and convert the bytes to UTF-8 first
|
// try and convert the bytes to UTF-8 first
|
||||||
match from_utf8(raw_line.as_slice()) {
|
match from_utf8(raw_line.as_slice()) {
|
||||||
Some(line) => {
|
Some(line) => {
|
||||||
word_count += line.words().len();
|
word_count += line.words().count();
|
||||||
current_char_count = line.chars().len();
|
current_char_count = line.chars().count();
|
||||||
char_count += current_char_count;
|
char_count += current_char_count;
|
||||||
},
|
},
|
||||||
None => {
|
None => {
|
||||||
word_count += raw_line.as_slice().split(|&x| is_word_seperator(x)).len();
|
word_count += raw_line.as_slice().split(|&x| is_word_seperator(x)).count();
|
||||||
for byte in raw_line.iter() {
|
for byte in raw_line.iter() {
|
||||||
match byte.is_ascii() {
|
match byte.is_ascii() {
|
||||||
true => {
|
true => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue