Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect missing of trimming all-space text events when trim_text_start = false and trim_text_end = true #755

Merged
merged 13 commits into from
Jun 14, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move consuming input inside match
Mingun committed Jun 14, 2024
commit 77b8212e714df282d3d6439415daf339aba8426f
16 changes: 10 additions & 6 deletions src/reader/buffered_reader.rs
Original file line number Diff line number Diff line change
@@ -72,19 +72,23 @@ macro_rules! impl_buffered_source {
}
};

let used = match memchr::memchr(byte, available) {
match memchr::memchr(byte, available) {
Some(i) => {
buf.extend_from_slice(&available[..i]);
done = true;
i + 1

let used = i + 1;
self $(.$reader)? .consume(used);
read += used;
}
None => {
buf.extend_from_slice(available);
available.len()

let used = available.len();
self $(.$reader)? .consume(used);
read += used;
}
};
self $(.$reader)? .consume(used);
read += used;
}
}
*position += read;