Skip to content

Commit

Permalink
Improve splitting lines from text.
Browse files Browse the repository at this point in the history
This change will resolve clippy warning about patterns too since we are
not using `split()` anymore
  • Loading branch information
AmmarAbouZor committed Sep 6, 2024
1 parent 88a67f5 commit 51352e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion application/apps/indexer/processor/src/text_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ impl TextFileSource {
file_part: &FilePart,
) -> Result<Vec<String>, GrabError> {
Ok(String::from_utf8_lossy(read_buf)
.split(|c| c == '\n')
.lines()
.take(file_part.total_lines - file_part.lines_to_drop)
.skip(file_part.lines_to_skip)
.map(|s| s.to_string())
Expand Down

0 comments on commit 51352e8

Please sign in to comment.