mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-06-25 14:22:54 +02:00
grep-matcher: add LineTerminator::is_suffix
This centralizes the logic for checking whether a line has a line terminator or not.
This commit is contained in:
@ -1396,7 +1396,7 @@ impl<'a, M: Matcher, W: WriteColor> StandardImpl<'a, M, W> {
|
||||
}
|
||||
|
||||
fn has_line_terminator(&self, buf: &[u8]) -> bool {
|
||||
buf.last() == Some(&self.searcher.line_terminator().as_byte())
|
||||
self.searcher.line_terminator().is_suffix(buf)
|
||||
}
|
||||
|
||||
fn is_context(&self) -> bool {
|
||||
|
Reference in New Issue
Block a user