Skip to content

Commit

Permalink
std/encoding/csv: use the new Scanner
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Nov 14, 2024
1 parent 8f7b39e commit a4ae79d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions std/encoding/csv/reader.jule
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
// field`, `comma is ,`}

use "std/bytes"
use "std/bufio"
use "std/io"
use "std/unicode"
use "std/unicode/utf8"
Expand Down Expand Up @@ -140,7 +141,7 @@ struct Reader {
// By default, each call to read returns newly allocated memory owned by the caller.
ReuseRecord: bool

s: &io::Scanner
s: &bufio::Scanner

// The current line being read in the CSV file.
numLine: int
Expand Down Expand Up @@ -174,7 +175,7 @@ impl Reader {
static fn New(mut r: io::Reader): &Reader {
ret &Reader{
Comma: ',',
s: io::Scanner.New(r),
s: bufio::Scanner.New(r),
}
}

Expand Down Expand Up @@ -240,7 +241,7 @@ impl Reader {
if !scan {
ret nil
}
mut line := self.s.Bytes()
mut line := self.s.Token()
if len(line) == 0 {
ret nil
}
Expand Down

0 comments on commit a4ae79d

Please sign in to comment.