Skip to content

searcher: add LineStep::advance_to - #3580

Open
samanyudas wants to merge 2 commits into
BurntSushi:masterfrom
samanyudas:searcher-linestep-advance-to
Open

samanyudas wants to merge 2 commits into
BurntSushi:masterfrom
samanyudas:searcher-linestep-advance-to

Conversation

@samanyudas

Copy link
Copy Markdown

Add advance_to(pos) to set the position of LineStep without reading each line.

  • If pos is inside a line, the next call returns the rest of that line.
  • If pos is before the current position, the iterator returns lines again.
  • If pos equals the configured end, iteration stops.
  • If pos exceeds the configured end, the method panics.

Tests check these cases and compare the results with a new iterator.

Formatting checks, tests, and documentation generation passed in the earlier local run.

I used AI to help write the code, tests, and this description.
I reviewed the changes and understand how they work.

Closes #1618.

samanyudas and others added 2 commits October 28, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

grep-searcher: Advance LineStep without iterating

1 participant