Skip to content

Commit baa0cba

Browse files
committed
[wc] remove w_space from CountInfo
1 parent cb88f8b commit baa0cba

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

text/wc.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ struct CountInfo {
4242
words: usize,
4343
chars: usize,
4444
nl: usize,
45-
was_space: bool,
4645
}
4746

4847
impl CountInfo {
@@ -51,7 +50,6 @@ impl CountInfo {
5150
words: 0,
5251
chars: 0,
5352
nl: 0,
54-
was_space: true,
5553
}
5654
}
5755

@@ -128,7 +126,7 @@ fn wc_file_bytes(count: &mut CountInfo, pathname: &PathBuf, table: &[bool; 256])
128126
let mut file = plib::io::input_stream(pathname, false)?;
129127

130128
let mut buffer = [0; plib::BUFSZ];
131-
let mut was_space = count.was_space;
129+
let mut was_space = true;
132130

133131
loop {
134132
let n_read = file.read(&mut buffer[..])?;
@@ -147,7 +145,6 @@ fn wc_file_bytes(count: &mut CountInfo, pathname: &PathBuf, table: &[bool; 256])
147145
was_space = is_space;
148146
}
149147
}
150-
count.was_space = was_space;
151148

152149
Ok(())
153150
}

0 commit comments

Comments
 (0)