This commit is contained in:
yorkart 2025-07-05 15:10:51 +02:00 committed by GitHub
commit ec56dc74a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -37,7 +37,11 @@ where
pub(crate) fn run(mut self) -> Result<(), S::Error> {
if self.core.begin()? {
while self.fill()? && self.core.match_by_line(self.rdr.buffer())? {
while self.fill()? {
if !self.core.match_by_line(self.rdr.buffer())? {
self.consumed_remain();
break;
}
}
}
self.core.finish(
@ -46,6 +50,11 @@ where
)
}
fn consumed_remain(&mut self) {
let consumed = self.core.pos();
self.rdr.consume(consumed);
}
fn fill(&mut self) -> Result<bool, S::Error> {
assert!(self.rdr.buffer()[self.core.pos()..].is_empty());