mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-08-04 10:08:36 +00:00
Merge bffc125455
into 3b7fd442a6
This commit is contained in:
commit
ec56dc74a1
1 changed files with 10 additions and 1 deletions
|
@ -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());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue