Skip to content

Commit

Permalink
fix: quell notice
Browse files Browse the repository at this point in the history
  • Loading branch information
JalonSolov committed Jan 26, 2024
1 parent 4b63a1e commit 40e9512
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wc/wc.v
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct FileChunk {
mut:
prev_char_is_space bool
buffer []u8
is_last_chunk bool = false
is_last_chunk bool
}

struct Count {
Expand Down Expand Up @@ -105,7 +105,7 @@ fn (mut file_reader FileReader) read_chunk(mut buffer []u8) ?FileChunk {
}

nbytes := file_reader.file.read(mut buffer) or { return none } // Propagate error. Either EOF or read error.
mut chunk := FileChunk{file_reader.last_char_is_space, buffer[..nbytes], false}
mut chunk := FileChunk{file_reader.last_char_is_space, buffer[..nbytes].clone(), false}
file_reader.last_char_is_space = is_space(buffer[nbytes - 1])
if nbytes < buffer.len {
chunk.is_last_chunk = true
Expand Down

0 comments on commit 40e9512

Please sign in to comment.