From c5c63627828a8081b40df97079959e58a5183359 Mon Sep 17 00:00:00 2001 From: Michael Gehring Date: Mon, 9 Jun 2014 10:31:42 +0200 Subject: [PATCH] wc: fix build with rust master --- wc/wc.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wc/wc.rs b/wc/wc.rs index 5ee9a92b2..9bf76cde2 100644 --- a/wc/wc.rs +++ b/wc/wc.rs @@ -127,12 +127,12 @@ pub fn wc(files: Vec, matches: &Matches) { // try and convert the bytes to UTF-8 first match from_utf8(raw_line.as_slice()) { Some(line) => { - word_count += line.words().len(); - current_char_count = line.chars().len(); + word_count += line.words().count(); + current_char_count = line.chars().count(); char_count += current_char_count; }, 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() { match byte.is_ascii() { true => {