mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-08-01 04:32:01 -07:00
warnings: remove/tweak some dead code
It looks like the dead code detector got better, so do a little code cleanup.
This commit is contained in:
@@ -467,6 +467,7 @@ impl<'s, M: Matcher, S: Sink> Core<'s, M, S> {
|
||||
let keepgoing = self.sink.context(
|
||||
&self.searcher,
|
||||
&SinkContext {
|
||||
#[cfg(test)]
|
||||
line_term: self.config.line_term,
|
||||
bytes: &buf[*range],
|
||||
kind: SinkContextKind::Before,
|
||||
@@ -497,6 +498,7 @@ impl<'s, M: Matcher, S: Sink> Core<'s, M, S> {
|
||||
let keepgoing = self.sink.context(
|
||||
&self.searcher,
|
||||
&SinkContext {
|
||||
#[cfg(test)]
|
||||
line_term: self.config.line_term,
|
||||
bytes: &buf[*range],
|
||||
kind: SinkContextKind::After,
|
||||
@@ -526,6 +528,7 @@ impl<'s, M: Matcher, S: Sink> Core<'s, M, S> {
|
||||
let keepgoing = self.sink.context(
|
||||
&self.searcher,
|
||||
&SinkContext {
|
||||
#[cfg(test)]
|
||||
line_term: self.config.line_term,
|
||||
bytes: &buf[*range],
|
||||
kind: SinkContextKind::Other,
|
||||
|
@@ -88,7 +88,6 @@ where
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct SliceByLine<'s, M, S> {
|
||||
config: &'s Config,
|
||||
core: Core<'s, M, S>,
|
||||
slice: &'s [u8],
|
||||
}
|
||||
@@ -103,7 +102,6 @@ impl<'s, M: Matcher, S: Sink> SliceByLine<'s, M, S> {
|
||||
debug_assert!(!searcher.multi_line_with_matcher(&matcher));
|
||||
|
||||
SliceByLine {
|
||||
config: &searcher.config,
|
||||
core: Core::new(searcher, matcher, write_to, true),
|
||||
slice: slice,
|
||||
}
|
||||
|
@@ -436,6 +436,7 @@ pub enum SinkContextKind {
|
||||
/// A type that describes a contextual line reported by a searcher.
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct SinkContext<'b> {
|
||||
#[cfg(test)]
|
||||
pub(crate) line_term: LineTerminator,
|
||||
pub(crate) bytes: &'b [u8],
|
||||
pub(crate) kind: SinkContextKind,
|
||||
|
Reference in New Issue
Block a user