edition: initial 'cargo fix --edition' run

This commit is contained in:
Andrew Gallant 2021-06-01 19:29:50 -04:00
parent e4c4540f6a
commit 459a9c5637
40 changed files with 127 additions and 125 deletions

View File

@ -6,7 +6,7 @@ use std::process::Command;
use globset::{Glob, GlobSet, GlobSetBuilder}; use globset::{Glob, GlobSet, GlobSetBuilder};
use process::{CommandError, CommandReader, CommandReaderBuilder}; use crate::process::{CommandError, CommandReader, CommandReaderBuilder};
/// A builder for a matcher that determines which files get decompressed. /// A builder for a matcher that determines which files get decompressed.
#[derive(Clone, Debug)] #[derive(Clone, Debug)]

View File

@ -178,18 +178,18 @@ mod pattern;
mod process; mod process;
mod wtr; mod wtr;
pub use decompress::{ pub use crate::decompress::{
resolve_binary, DecompressionMatcher, DecompressionMatcherBuilder, resolve_binary, DecompressionMatcher, DecompressionMatcherBuilder,
DecompressionReader, DecompressionReaderBuilder, DecompressionReader, DecompressionReaderBuilder,
}; };
pub use escape::{escape, escape_os, unescape, unescape_os}; pub use crate::escape::{escape, escape_os, unescape, unescape_os};
pub use human::{parse_human_readable_size, ParseSizeError}; pub use crate::human::{parse_human_readable_size, ParseSizeError};
pub use pattern::{ pub use crate::pattern::{
pattern_from_bytes, pattern_from_os, patterns_from_path, pattern_from_bytes, pattern_from_os, patterns_from_path,
patterns_from_reader, patterns_from_stdin, InvalidPatternError, patterns_from_reader, patterns_from_stdin, InvalidPatternError,
}; };
pub use process::{CommandError, CommandReader, CommandReaderBuilder}; pub use crate::process::{CommandError, CommandReader, CommandReaderBuilder};
pub use wtr::{ pub use crate::wtr::{
stdout, stdout_buffered_block, stdout_buffered_line, StandardStream, stdout, stdout_buffered_block, stdout_buffered_line, StandardStream,
}; };

View File

@ -8,7 +8,7 @@ use std::str;
use bstr::io::BufReadExt; use bstr::io::BufReadExt;
use escape::{escape, escape_os}; use crate::escape::{escape, escape_os};
/// An error that occurs when a pattern could not be converted to valid UTF-8. /// An error that occurs when a pattern could not be converted to valid UTF-8.
/// ///

View File

@ -116,7 +116,7 @@ impl CommandReaderBuilder {
.stderr(process::Stdio::piped()) .stderr(process::Stdio::piped())
.spawn()?; .spawn()?;
let stderr = if self.async_stderr { let stderr = if self.async_stderr {
StderrReader::async(child.stderr.take().unwrap()) StderrReader::r#async(child.stderr.take().unwrap())
} else { } else {
StderrReader::sync(child.stderr.take().unwrap()) StderrReader::sync(child.stderr.take().unwrap())
}; };
@ -285,7 +285,7 @@ enum StderrReader {
impl StderrReader { impl StderrReader {
/// Create a reader for stderr that reads contents asynchronously. /// Create a reader for stderr that reads contents asynchronously.
fn async(mut stderr: process::ChildStderr) -> StderrReader { fn r#async(mut stderr: process::ChildStderr) -> StderrReader {
let handle = let handle =
thread::spawn(move || stderr_to_command_error(&mut stderr)); thread::spawn(move || stderr_to_command_error(&mut stderr));
StderrReader::Async(Some(handle)) StderrReader::Async(Some(handle))

View File

@ -2,7 +2,7 @@ use std::io;
use termcolor; use termcolor;
use is_tty_stdout; use crate::is_tty_stdout;
/// A writer that supports coloring with either line or block buffering. /// A writer that supports coloring with either line or block buffering.
pub struct StandardStream(StandardStreamKind); pub struct StandardStream(StandardStreamKind);

View File

@ -8,7 +8,7 @@ use std::str;
use regex; use regex;
use regex::bytes::Regex; use regex::bytes::Regex;
use {new_regex, Candidate, Error, ErrorKind}; use crate::{new_regex, Candidate, Error, ErrorKind};
/// Describes a matching strategy for a particular pattern. /// Describes a matching strategy for a particular pattern.
/// ///
@ -1015,7 +1015,7 @@ fn ends_with(needle: &[u8], haystack: &[u8]) -> bool {
mod tests { mod tests {
use super::Token::*; use super::Token::*;
use super::{Glob, GlobBuilder, Token}; use super::{Glob, GlobBuilder, Token};
use {ErrorKind, GlobSetBuilder}; use crate::{ErrorKind, GlobSetBuilder};
#[derive(Clone, Copy, Debug, Default)] #[derive(Clone, Copy, Debug, Default)]
struct Options { struct Options {

View File

@ -125,9 +125,9 @@ use aho_corasick::AhoCorasick;
use bstr::{ByteSlice, ByteVec, B}; use bstr::{ByteSlice, ByteVec, B};
use regex::bytes::{Regex, RegexBuilder, RegexSet}; use regex::bytes::{Regex, RegexBuilder, RegexSet};
use glob::MatchStrategy; use crate::glob::MatchStrategy;
pub use glob::{Glob, GlobBuilder, GlobMatcher}; pub use crate::glob::{Glob, GlobBuilder, GlobMatcher};
use pathutil::{file_name, file_name_ext, normalize_path}; use crate::pathutil::{file_name, file_name_ext, normalize_path};
mod glob; mod glob;
mod pathutil; mod pathutil;
@ -841,7 +841,7 @@ impl RequiredExtensionStrategyBuilder {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::{GlobSet, GlobSetBuilder}; use super::{GlobSet, GlobSetBuilder};
use glob::Glob; use crate::glob::Glob;
#[test] #[test]
fn set_works() { fn set_works() {

View File

@ -20,12 +20,12 @@ use std::io::{self, BufRead};
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::sync::{Arc, RwLock}; use std::sync::{Arc, RwLock};
use gitignore::{self, Gitignore, GitignoreBuilder}; use crate::gitignore::{self, Gitignore, GitignoreBuilder};
use overrides::{self, Override}; use crate::overrides::{self, Override};
use pathutil::{is_hidden, strip_prefix}; use crate::pathutil::{is_hidden, strip_prefix};
use types::{self, Types}; use crate::types::{self, Types};
use walk::DirEntry; use crate::walk::DirEntry;
use {Error, Match, PartialErrorBuilder}; use crate::{Error, Match, PartialErrorBuilder};
/// IgnoreMatch represents information about where a match came from when using /// IgnoreMatch represents information about where a match came from when using
/// the `Ignore` matcher. /// the `Ignore` matcher.
@ -840,10 +840,10 @@ mod tests {
use std::io::Write; use std::io::Write;
use std::path::Path; use std::path::Path;
use dir::IgnoreBuilder; use crate::dir::IgnoreBuilder;
use gitignore::Gitignore; use crate::gitignore::Gitignore;
use tests::TempDir; use crate::tests::TempDir;
use Error; use crate::Error;
fn wfile<P: AsRef<Path>>(path: P, contents: &str) { fn wfile<P: AsRef<Path>>(path: P, contents: &str) {
let mut file = File::create(path).unwrap(); let mut file = File::create(path).unwrap();

View File

@ -19,8 +19,8 @@ use globset::{Candidate, GlobBuilder, GlobSet, GlobSetBuilder};
use regex::bytes::Regex; use regex::bytes::Regex;
use thread_local::ThreadLocal; use thread_local::ThreadLocal;
use pathutil::{is_file_name, strip_prefix}; use crate::pathutil::{is_file_name, strip_prefix};
use {Error, Match, PartialErrorBuilder}; use crate::{Error, Match, PartialErrorBuilder};
/// Glob represents a single glob in a gitignore file. /// Glob represents a single glob in a gitignore file.
/// ///

View File

@ -64,7 +64,7 @@ use std::fmt;
use std::io; use std::io;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
pub use walk::{ pub use crate::walk::{
DirEntry, ParallelVisitor, ParallelVisitorBuilder, Walk, WalkBuilder, DirEntry, ParallelVisitor, ParallelVisitorBuilder, Walk, WalkBuilder,
WalkParallel, WalkState, WalkParallel, WalkState,
}; };

View File

@ -6,8 +6,8 @@ line tools.
use std::path::Path; use std::path::Path;
use gitignore::{self, Gitignore, GitignoreBuilder}; use crate::gitignore::{self, Gitignore, GitignoreBuilder};
use {Error, Match}; use crate::{Error, Match};
/// Glob represents a single glob in an override matcher. /// Glob represents a single glob in an override matcher.
/// ///

View File

@ -1,7 +1,7 @@
use std::ffi::OsStr; use std::ffi::OsStr;
use std::path::Path; use std::path::Path;
use walk::DirEntry; use crate::walk::DirEntry;
/// Returns true if and only if this entry is considered to be hidden. /// Returns true if and only if this entry is considered to be hidden.
/// ///

View File

@ -93,9 +93,9 @@ use globset::{GlobBuilder, GlobSet, GlobSetBuilder};
use regex::Regex; use regex::Regex;
use thread_local::ThreadLocal; use thread_local::ThreadLocal;
use default_types::DEFAULT_TYPES; use crate::default_types::DEFAULT_TYPES;
use pathutil::file_name; use crate::pathutil::file_name;
use {Error, Match}; use crate::{Error, Match};
/// Glob represents a single glob in a set of file type definitions. /// Glob represents a single glob in a set of file type definitions.
/// ///

View File

@ -13,11 +13,11 @@ use std::vec;
use same_file::Handle; use same_file::Handle;
use walkdir::{self, WalkDir}; use walkdir::{self, WalkDir};
use dir::{Ignore, IgnoreBuilder}; use crate::dir::{Ignore, IgnoreBuilder};
use gitignore::GitignoreBuilder; use crate::gitignore::GitignoreBuilder;
use overrides::Override; use crate::overrides::Override;
use types::Types; use crate::types::Types;
use {Error, PartialErrorBuilder}; use crate::{Error, PartialErrorBuilder};
/// A directory entry with a possible error attached. /// A directory entry with a possible error attached.
/// ///
@ -1852,7 +1852,7 @@ mod tests {
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use super::{DirEntry, WalkBuilder, WalkState}; use super::{DirEntry, WalkBuilder, WalkState};
use tests::TempDir; use crate::tests::TempDir;
fn wfile<P: AsRef<Path>>(path: P, contents: &str) { fn wfile<P: AsRef<Path>>(path: P, contents: &str) {
let mut file = File::create(path).unwrap(); let mut file = File::create(path).unwrap();

View File

@ -45,7 +45,7 @@ use std::io;
use std::ops; use std::ops;
use std::u64; use std::u64;
use interpolate::interpolate; use crate::interpolate::interpolate;
mod interpolate; mod interpolate;

View File

@ -1,7 +1,7 @@
use grep_matcher::{Captures, Match, Matcher}; use grep_matcher::{Captures, Match, Matcher};
use regex::bytes::Regex; use regex::bytes::Regex;
use util::{RegexMatcher, RegexMatcherNoCaps}; use crate::util::{RegexMatcher, RegexMatcherNoCaps};
fn matcher(pattern: &str) -> RegexMatcher { fn matcher(pattern: &str) -> RegexMatcher {
RegexMatcher::new(Regex::new(pattern).unwrap()) RegexMatcher::new(Regex::new(pattern).unwrap())

View File

@ -8,8 +8,8 @@ An implementation of `grep-matcher`'s `Matcher` trait for
extern crate grep_matcher; extern crate grep_matcher;
extern crate pcre2; extern crate pcre2;
pub use error::{Error, ErrorKind}; pub use crate::error::{Error, ErrorKind};
pub use matcher::{RegexCaptures, RegexMatcher, RegexMatcherBuilder}; pub use crate::matcher::{RegexCaptures, RegexMatcher, RegexMatcherBuilder};
pub use pcre2::{is_jit_available, version}; pub use pcre2::{is_jit_available, version};
mod error; mod error;

View File

@ -3,7 +3,7 @@ use std::collections::HashMap;
use grep_matcher::{Captures, Match, Matcher}; use grep_matcher::{Captures, Match, Matcher};
use pcre2::bytes::{CaptureLocations, Regex, RegexBuilder}; use pcre2::bytes::{CaptureLocations, Regex, RegexBuilder};
use error::Error; use crate::error::Error;
/// A builder for configuring the compilation of a PCRE2 regex. /// A builder for configuring the compilation of a PCRE2 regex.
#[derive(Clone, Debug)] #[derive(Clone, Debug)]

View File

@ -8,10 +8,10 @@ use grep_searcher::{
}; };
use serde_json as json; use serde_json as json;
use counter::CounterWriter; use crate::counter::CounterWriter;
use jsont; use crate::jsont;
use stats::Stats; use crate::stats::Stats;
use util::find_iter_at_in_context; use crate::util::find_iter_at_in_context;
/// The configuration for the JSON printer. /// The configuration for the JSON printer.
/// ///

View File

@ -13,7 +13,7 @@ use std::str;
use base64; use base64;
use serde::{Serialize, Serializer}; use serde::{Serialize, Serializer};
use stats::Stats; use crate::stats::Stats;
#[derive(Serialize)] #[derive(Serialize)]
#[serde(tag = "type", content = "data")] #[serde(tag = "type", content = "data")]

View File

@ -84,13 +84,15 @@ extern crate serde_derive;
extern crate serde_json; extern crate serde_json;
extern crate termcolor; extern crate termcolor;
pub use color::{default_color_specs, ColorError, ColorSpecs, UserColorSpec}; pub use crate::color::{
default_color_specs, ColorError, ColorSpecs, UserColorSpec,
};
#[cfg(feature = "serde1")] #[cfg(feature = "serde1")]
pub use json::{JSONBuilder, JSONSink, JSON}; pub use crate::json::{JSONBuilder, JSONSink, JSON};
pub use standard::{Standard, StandardBuilder, StandardSink}; pub use crate::standard::{Standard, StandardBuilder, StandardSink};
pub use stats::Stats; pub use crate::stats::Stats;
pub use summary::{Summary, SummaryBuilder, SummaryKind, SummarySink}; pub use crate::summary::{Summary, SummaryBuilder, SummaryKind, SummarySink};
pub use util::PrinterPath; pub use crate::util::PrinterPath;
// The maximum number of bytes to execute a search to account for look-ahead. // The maximum number of bytes to execute a search to account for look-ahead.
// //

View File

@ -13,10 +13,10 @@ use grep_searcher::{
}; };
use termcolor::{ColorSpec, NoColor, WriteColor}; use termcolor::{ColorSpec, NoColor, WriteColor};
use color::ColorSpecs; use crate::color::ColorSpecs;
use counter::CounterWriter; use crate::counter::CounterWriter;
use stats::Stats; use crate::stats::Stats;
use util::{ use crate::util::{
find_iter_at_in_context, trim_ascii_prefix, trim_line_terminator, find_iter_at_in_context, trim_ascii_prefix, trim_line_terminator,
PrinterPath, Replacer, Sunk, PrinterPath, Replacer, Sunk,
}; };

View File

@ -1,7 +1,7 @@
use std::ops::{Add, AddAssign}; use std::ops::{Add, AddAssign};
use std::time::Duration; use std::time::Duration;
use util::NiceDuration; use crate::util::NiceDuration;
/// Summary statistics produced at the end of a search. /// Summary statistics produced at the end of a search.
/// ///

View File

@ -8,10 +8,10 @@ use grep_matcher::Matcher;
use grep_searcher::{Searcher, Sink, SinkError, SinkFinish, SinkMatch}; use grep_searcher::{Searcher, Sink, SinkError, SinkFinish, SinkMatch};
use termcolor::{ColorSpec, NoColor, WriteColor}; use termcolor::{ColorSpec, NoColor, WriteColor};
use color::ColorSpecs; use crate::color::ColorSpecs;
use counter::CounterWriter; use crate::counter::CounterWriter;
use stats::Stats; use crate::stats::Stats;
use util::{find_iter_at_in_context, PrinterPath}; use crate::util::{find_iter_at_in_context, PrinterPath};
/// The configuration for the summary printer. /// The configuration for the summary printer.
/// ///

View File

@ -12,7 +12,7 @@ use grep_searcher::{
#[cfg(feature = "serde1")] #[cfg(feature = "serde1")]
use serde::{Serialize, Serializer}; use serde::{Serialize, Serializer};
use MAX_LOOK_AHEAD; use crate::MAX_LOOK_AHEAD;
/// A type for handling replacements while amortizing allocation. /// A type for handling replacements while amortizing allocation.
pub struct Replacer<M: Matcher> { pub struct Replacer<M: Matcher> {

View File

@ -3,13 +3,13 @@ use regex::bytes::{Regex, RegexBuilder};
use regex_syntax::ast::{self, Ast}; use regex_syntax::ast::{self, Ast};
use regex_syntax::hir::{self, Hir}; use regex_syntax::hir::{self, Hir};
use ast::AstAnalysis; use crate::ast::AstAnalysis;
use crlf::crlfify; use crate::crlf::crlfify;
use error::Error; use crate::error::Error;
use literal::LiteralSets; use crate::literal::LiteralSets;
use multi::alternation_literals; use crate::multi::alternation_literals;
use non_matching::non_matching_bytes; use crate::non_matching::non_matching_bytes;
use strip::strip_from_match; use crate::strip::strip_from_match;
/// Config represents the configuration of a regex matcher in this crate. /// Config represents the configuration of a regex matcher in this crate.
/// The configuration is itself a rough combination of the knobs found in /// The configuration is itself a rough combination of the knobs found in

View File

@ -4,9 +4,9 @@ use grep_matcher::{Match, Matcher, NoError};
use regex::bytes::Regex; use regex::bytes::Regex;
use regex_syntax::hir::{self, Hir, HirKind}; use regex_syntax::hir::{self, Hir, HirKind};
use config::ConfiguredHIR; use crate::config::ConfiguredHIR;
use error::Error; use crate::error::Error;
use matcher::RegexCaptures; use crate::matcher::RegexCaptures;
/// A matcher for implementing "word match" semantics. /// A matcher for implementing "word match" semantics.
#[derive(Clone, Debug)] #[derive(Clone, Debug)]

View File

@ -1,7 +1,7 @@
use std::error; use std::error;
use std::fmt; use std::fmt;
use util; use crate::util;
/// An error that can occur in this crate. /// An error that can occur in this crate.
/// ///

View File

@ -13,8 +13,8 @@ extern crate regex;
extern crate regex_syntax; extern crate regex_syntax;
extern crate thread_local; extern crate thread_local;
pub use error::{Error, ErrorKind}; pub use crate::error::{Error, ErrorKind};
pub use matcher::{RegexCaptures, RegexMatcher, RegexMatcherBuilder}; pub use crate::matcher::{RegexCaptures, RegexMatcher, RegexMatcherBuilder};
mod ast; mod ast;
mod config; mod config;

View File

@ -9,7 +9,7 @@ use bstr::ByteSlice;
use regex_syntax::hir::literal::{Literal, Literals}; use regex_syntax::hir::literal::{Literal, Literals};
use regex_syntax::hir::{self, Hir, HirKind}; use regex_syntax::hir::{self, Hir, HirKind};
use util; use crate::util;
/// Represents prefix, suffix and inner "required" literals for a regular /// Represents prefix, suffix and inner "required" literals for a regular
/// expression. /// expression.

View File

@ -5,11 +5,11 @@ use grep_matcher::{
}; };
use regex::bytes::{CaptureLocations, Regex}; use regex::bytes::{CaptureLocations, Regex};
use config::{Config, ConfiguredHIR}; use crate::config::{Config, ConfiguredHIR};
use crlf::CRLFMatcher; use crate::crlf::CRLFMatcher;
use error::Error; use crate::error::Error;
use multi::MultiLiteralMatcher; use crate::multi::MultiLiteralMatcher;
use word::WordMatcher; use crate::word::WordMatcher;
/// A builder for constructing a `Matcher` using regular expressions. /// A builder for constructing a `Matcher` using regular expressions.
/// ///

View File

@ -2,8 +2,8 @@ use aho_corasick::{AhoCorasick, AhoCorasickBuilder, MatchKind};
use grep_matcher::{Match, Matcher, NoError}; use grep_matcher::{Match, Matcher, NoError};
use regex_syntax::hir::Hir; use regex_syntax::hir::Hir;
use error::Error; use crate::error::Error;
use matcher::RegexCaptures; use crate::matcher::RegexCaptures;
/// A matcher for an alternation of literals. /// A matcher for an alternation of literals.
/// ///

View File

@ -1,7 +1,7 @@
use grep_matcher::LineTerminator; use grep_matcher::LineTerminator;
use regex_syntax::hir::{self, Hir, HirKind}; use regex_syntax::hir::{self, Hir, HirKind};
use error::{Error, ErrorKind}; use crate::error::{Error, ErrorKind};
/// Return an HIR that is guaranteed to never match the given line terminator, /// Return an HIR that is guaranteed to never match the given line terminator,
/// if possible. /// if possible.
@ -106,7 +106,7 @@ mod tests {
use regex_syntax::Parser; use regex_syntax::Parser;
use super::{strip_from_match, LineTerminator}; use super::{strip_from_match, LineTerminator};
use error::Error; use crate::error::Error;
fn roundtrip(pattern: &str, byte: u8) -> String { fn roundtrip(pattern: &str, byte: u8) -> String {
roundtrip_line_term(pattern, LineTerminator::byte(byte)).unwrap() roundtrip_line_term(pattern, LineTerminator::byte(byte)).unwrap()

View File

@ -6,9 +6,9 @@ use grep_matcher::{Match, Matcher, NoError};
use regex::bytes::{CaptureLocations, Regex}; use regex::bytes::{CaptureLocations, Regex};
use thread_local::ThreadLocal; use thread_local::ThreadLocal;
use config::ConfiguredHIR; use crate::config::ConfiguredHIR;
use error::Error; use crate::error::Error;
use matcher::RegexCaptures; use crate::matcher::RegexCaptures;
/// A matcher for implementing "word match" semantics. /// A matcher for implementing "word match" semantics.
#[derive(Debug)] #[derive(Debug)]
@ -184,7 +184,7 @@ impl Matcher for WordMatcher {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::WordMatcher; use super::WordMatcher;
use config::Config; use crate::config::Config;
use grep_matcher::{Captures, Match, Matcher}; use grep_matcher::{Captures, Match, Matcher};
fn matcher(pattern: &str) -> WordMatcher { fn matcher(pattern: &str) -> WordMatcher {

View File

@ -110,13 +110,13 @@ extern crate memmap;
#[cfg(test)] #[cfg(test)]
extern crate regex; extern crate regex;
pub use lines::{LineIter, LineStep}; pub use crate::lines::{LineIter, LineStep};
pub use searcher::{ pub use crate::searcher::{
BinaryDetection, ConfigError, Encoding, MmapChoice, Searcher, BinaryDetection, ConfigError, Encoding, MmapChoice, Searcher,
SearcherBuilder, SearcherBuilder,
}; };
pub use sink::sinks; pub use crate::sink::sinks;
pub use sink::{ pub use crate::sink::{
Sink, SinkContext, SinkContextKind, SinkError, SinkFinish, SinkMatch, Sink, SinkContext, SinkContextKind, SinkError, SinkFinish, SinkMatch,
}; };

View File

@ -2,13 +2,13 @@ use std::cmp;
use bstr::ByteSlice; use bstr::ByteSlice;
use grep_matcher::{LineMatchKind, Matcher}; use crate::line_buffer::BinaryDetection;
use line_buffer::BinaryDetection; use crate::lines::{self, LineStep};
use lines::{self, LineStep}; use crate::searcher::{Config, Range, Searcher};
use searcher::{Config, Range, Searcher}; use crate::sink::{
use sink::{
Sink, SinkContext, SinkContextKind, SinkError, SinkFinish, SinkMatch, Sink, SinkContext, SinkContextKind, SinkError, SinkFinish, SinkMatch,
}; };
use grep_matcher::{LineMatchKind, Matcher};
#[derive(Debug)] #[derive(Debug)]
pub struct Core<'s, M: 's, S> { pub struct Core<'s, M: 's, S> {

View File

@ -1,13 +1,13 @@
use std::cmp; use std::cmp;
use std::io; use std::io;
use crate::line_buffer::{LineBufferReader, DEFAULT_BUFFER_CAPACITY};
use crate::lines::{self, LineStep};
use crate::sink::{Sink, SinkError};
use grep_matcher::Matcher; use grep_matcher::Matcher;
use line_buffer::{LineBufferReader, DEFAULT_BUFFER_CAPACITY};
use lines::{self, LineStep};
use sink::{Sink, SinkError};
use searcher::core::Core; use crate::searcher::core::Core;
use searcher::{Config, Range, Searcher}; use crate::searcher::{Config, Range, Searcher};
#[derive(Debug)] #[derive(Debug)]
pub struct ReadByLine<'s, M: 's, R, S> { pub struct ReadByLine<'s, M: 's, R, S> {
@ -349,8 +349,8 @@ impl<'s, M: Matcher, S: Sink> MultiLine<'s, M, S> {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use searcher::{BinaryDetection, SearcherBuilder}; use crate::searcher::{BinaryDetection, SearcherBuilder};
use testutil::{KitchenSink, RegexMatcher, SearcherTester}; use crate::testutil::{KitchenSink, RegexMatcher, SearcherTester};
use super::*; use super::*;
@ -1488,8 +1488,8 @@ byte count:307
#[test] #[test]
fn scratch() { fn scratch() {
use sinks; use crate::sinks;
use testutil::RegexMatcher; use crate::testutil::RegexMatcher;
const SHERLOCK: &'static [u8] = b"\ const SHERLOCK: &'static [u8] = b"\
For the Doctor Wat\xFFsons of this world, as opposed to the Sherlock For the Doctor Wat\xFFsons of this world, as opposed to the Sherlock

View File

@ -5,15 +5,15 @@ use std::fs::File;
use std::io::{self, Read}; use std::io::{self, Read};
use std::path::Path; use std::path::Path;
use encoding_rs; use crate::line_buffer::{
use encoding_rs_io::DecodeReaderBytesBuilder;
use grep_matcher::{LineTerminator, Match, Matcher};
use line_buffer::{
self, alloc_error, BufferAllocation, LineBuffer, LineBufferBuilder, self, alloc_error, BufferAllocation, LineBuffer, LineBufferBuilder,
LineBufferReader, DEFAULT_BUFFER_CAPACITY, LineBufferReader, DEFAULT_BUFFER_CAPACITY,
}; };
use searcher::glue::{MultiLine, ReadByLine, SliceByLine}; use crate::searcher::glue::{MultiLine, ReadByLine, SliceByLine};
use sink::{Sink, SinkError}; use crate::sink::{Sink, SinkError};
use encoding_rs;
use encoding_rs_io::DecodeReaderBytesBuilder;
use grep_matcher::{LineTerminator, Match, Matcher};
pub use self::mmap::MmapChoice; pub use self::mmap::MmapChoice;
@ -990,7 +990,7 @@ fn slice_has_bom(slice: &[u8]) -> bool {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use testutil::{KitchenSink, RegexMatcher}; use crate::testutil::{KitchenSink, RegexMatcher};
#[test] #[test]
fn config_error_heap_limit() { fn config_error_heap_limit() {

View File

@ -4,8 +4,8 @@ use std::io;
use grep_matcher::LineTerminator; use grep_matcher::LineTerminator;
use lines::LineIter; use crate::lines::LineIter;
use searcher::{ConfigError, Searcher}; use crate::searcher::{ConfigError, Searcher};
/// A trait that describes errors that can be reported by searchers and /// A trait that describes errors that can be reported by searchers and
/// implementations of `Sink`. /// implementations of `Sink`.
@ -514,7 +514,7 @@ pub mod sinks {
use std::str; use std::str;
use super::{Sink, SinkError, SinkMatch}; use super::{Sink, SinkError, SinkMatch};
use searcher::Searcher; use crate::searcher::Searcher;
/// A sink that provides line numbers and matches as strings while ignoring /// A sink that provides line numbers and matches as strings while ignoring
/// everything else. /// everything else.

View File

@ -7,8 +7,8 @@ use grep_matcher::{
}; };
use regex::bytes::{Regex, RegexBuilder}; use regex::bytes::{Regex, RegexBuilder};
use searcher::{BinaryDetection, Searcher, SearcherBuilder}; use crate::searcher::{BinaryDetection, Searcher, SearcherBuilder};
use sink::{Sink, SinkContext, SinkFinish, SinkMatch}; use crate::sink::{Sink, SinkContext, SinkFinish, SinkMatch};
/// A simple regex matcher. /// A simple regex matcher.
/// ///