summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2021-06-01 20:45:45 -0400
committerAndrew Gallant <jamslam@gmail.com>2021-06-01 21:07:37 -0400
commite824531e387b96b43fd2c2d396c884c010eb13d4 (patch)
treeac6dc8dfa65f55daa72cac3e7cf7a6b763296041
parentaf54069c51cc3656c9c343a7fb3c9360cfddf505 (diff)
edition: manual changes
This is mostly just about removing 'extern crate' everywhere and fixing the fallout.
-rw-r--r--Cargo.lock4
-rw-r--r--crates/cli/README.md6
-rw-r--r--crates/cli/src/decompress.rs4
-rw-r--r--crates/cli/src/human.rs2
-rw-r--r--crates/cli/src/lib.rs7
-rw-r--r--crates/cli/src/process.rs2
-rw-r--r--crates/globset/README.md6
-rw-r--r--crates/globset/benches/bench.rs3
-rw-r--r--crates/globset/src/lib.rs62
-rw-r--r--crates/grep/README.md6
-rw-r--r--crates/ignore/README.md6
-rw-r--r--crates/ignore/examples/walk.rs6
-rw-r--r--crates/ignore/src/dir.rs2
-rw-r--r--crates/ignore/src/gitignore.rs2
-rw-r--r--crates/ignore/src/lib.rs13
-rw-r--r--crates/ignore/src/types.rs2
-rw-r--r--crates/ignore/src/walk.rs6
-rw-r--r--crates/matcher/README.md6
-rw-r--r--crates/pcre2/README.md6
-rw-r--r--crates/printer/Cargo.toml5
-rw-r--r--crates/printer/README.md6
-rw-r--r--crates/printer/src/color.rs3
-rw-r--r--crates/printer/src/lib.rs18
-rw-r--r--crates/printer/src/stats.rs2
-rw-r--r--crates/regex/README.md6
-rw-r--r--crates/regex/src/lib.rs10
-rw-r--r--crates/regex/src/literal.rs20
-rw-r--r--crates/regex/src/matcher.rs4
-rw-r--r--crates/regex/src/word.rs2
-rw-r--r--crates/searcher/README.md6
-rw-r--r--crates/searcher/src/lib.rs7
-rw-r--r--crates/searcher/src/searcher/core.rs4
-rw-r--r--crates/searcher/src/searcher/mmap.rs4
-rw-r--r--crates/searcher/src/searcher/mod.rs27
34 files changed, 93 insertions, 182 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 8e4ac7e6..573a82f4 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -224,7 +224,6 @@ dependencies = [
"grep-regex",
"grep-searcher",
"serde",
- "serde_derive",
"serde_json",
"termcolor",
]
@@ -500,6 +499,9 @@ name = "serde"
version = "1.0.125"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "558dc50e1a5a5fa7112ca2ce4effcb321b0300c0d4ccf0776a9f60cd89031171"
+dependencies = [
+ "serde_derive",
+]
[[package]]
name = "serde_derive"
diff --git a/crates/cli/README.md b/crates/cli/README.md
index c1cc02bd..c3fb875c 100644
--- a/crates/cli/README.md
+++ b/crates/cli/README.md
@@ -29,9 +29,3 @@ Add this to your `Cargo.toml`:
[dependencies]
grep-cli = "0.1"
```
-
-and this to your crate root:
-
-```rust
-extern crate grep_cli;
-```
diff --git a/crates/cli/src/decompress.rs b/crates/cli/src/decompress.rs
index f9637acc..365660ce 100644
--- a/crates/cli/src/decompress.rs
+++ b/crates/cli/src/decompress.rs
@@ -230,7 +230,7 @@ impl DecompressionReaderBuilder {
match self.command_builder.build(&mut cmd) {
Ok(cmd_reader) => Ok(DecompressionReader { rdr: Ok(cmd_reader) }),
Err(err) => {
- debug!(
+ log::debug!(
"{}: error spawning command '{:?}': {} \
(falling back to uncompressed reader)",
path.display(),
@@ -479,7 +479,7 @@ fn default_decompression_commands() -> Vec<DecompressionCommand> {
let bin = match resolve_binary(Path::new(args[0])) {
Ok(bin) => bin,
Err(err) => {
- debug!("{}", err);
+ log::debug!("{}", err);
return;
}
};
diff --git a/crates/cli/src/human.rs b/crates/cli/src/human.rs
index 07161738..2c4213db 100644
--- a/crates/cli/src/human.rs
+++ b/crates/cli/src/human.rs
@@ -88,7 +88,7 @@ impl From<ParseSizeError> for io::Error {
///
/// Additional suffixes may be added over time.
pub fn parse_human_readable_size(size: &str) -> Result<u64, ParseSizeError> {
- lazy_static! {
+ lazy_static::lazy_static! {
// Normally I'd just parse something this simple by hand to avoid the
// regex dep, but we bring regex in any way for glob matching, so might
// as well use it.
diff --git a/crates/cli/src/lib.rs b/crates/cli/src/lib.rs
index c9a6aa9c..3b928e8a 100644
--- a/crates/cli/src/lib.rs
+++ b/crates/cli/src/lib.rs
@@ -158,13 +158,6 @@ error message is crafted that typically tells the user how to fix the problem.
#![deny(missing_docs)]
-use atty;
-
-#[macro_use]
-extern crate lazy_static;
-#[macro_use]
-extern crate log;
-
mod decompress;
mod escape;
mod human;
diff --git a/crates/cli/src/process.rs b/crates/cli/src/process.rs
index d0d490c2..277f0182 100644
--- a/crates/cli/src/process.rs
+++ b/crates/cli/src/process.rs
@@ -254,7 +254,7 @@ impl CommandReader {
impl Drop for CommandReader {
fn drop(&mut self) {
if let Err(error) = self.close() {
- warn!("{}", error);
+ log::warn!("{}", error);
}
}
}
diff --git a/crates/globset/README.md b/crates/globset/README.md
index 17cab82c..806c915b 100644
--- a/crates/globset/README.md
+++ b/crates/globset/README.md
@@ -22,12 +22,6 @@ Add this to your `Cargo.toml`:
globset = "0.3"
```
-and this to your crate root:
-
-```rust
-extern crate globset;
-```
-
### Features
* `serde1`: Enables implementing Serde traits on the `Glob` type.
diff --git a/crates/globset/benches/bench.rs b/crates/globset/benches/bench.rs
index c2619813..1344a8f6 100644
--- a/crates/globset/benches/bench.rs
+++ b/crates/globset/benches/bench.rs
@@ -4,9 +4,6 @@ tool itself, see the benchsuite directory.
*/
#![feature(test)]
-use glob;
-
-
extern crate test;
use globset::{Candidate, Glob, GlobMatcher, GlobSet, GlobSetBuilder};
diff --git a/crates/globset/src/lib.rs b/crates/globset/src/lib.rs
index f5273e02..d14685f1 100644
--- a/crates/globset/src/lib.rs
+++ b/crates/globset/src/lib.rs
@@ -103,16 +103,6 @@ or to enable case insensitive matching.
#![deny(missing_docs)]
-
-
-use fnv;
-#[macro_use]
-extern crate log;
-use regex;
-
-#[cfg(feature = "serde1")]
-extern crate serde;
-
use std::borrow::Cow;
use std::collections::{BTreeMap, HashMap};
use std::error::Error as StdError;
@@ -423,12 +413,12 @@ impl GlobSet {
required_exts.add(i, ext, p.regex().to_owned());
}
MatchStrategy::Regex => {
- debug!("glob converted to regex: {:?}", p);
+ log::debug!("glob converted to regex: {:?}", p);
regexes.add(i, p.regex().to_owned());
}
}
}
- debug!(
+ log::debug!(
"built glob set; {} literals, {} basenames, {} extensions, \
{} prefixes, {} suffixes, {} required extensions, {} regexes",
lits.0.len(),
@@ -556,7 +546,11 @@ impl GlobSetMatchStrategy {
}
}
- fn matches_into(&self, candidate: &Candidate<'_>, matches: &mut Vec<usize>) {
+ fn matches_into(
+ &self,
+ candidate: &Candidate<'_>,
+ matches: &mut Vec<usize>,
+ ) {
use self::GlobSetMatchStrategy::*;
match *self {
Literal(ref s) => s.matches_into(candidate, matches),
@@ -587,7 +581,11 @@ impl LiteralStrategy {
}
#[inline(never)]
- fn matches_into(&self, candidate: &Candidate<'_>, matches: &mut Vec<usize>) {
+ fn matches_into(
+ &self,
+ candidate: &Candidate<'_>,
+ matches: &mut Vec<usize>,
+ ) {
if let Some(hits) = self.0.get(candidate.path.as_bytes()) {
matches.extend(hits);
}
@@ -614,7 +612,11 @@ impl BasenameLiteralStrategy {
}
#[inline(never)]
- fn matches_into(&self, candidate: &Candidate<'_>, matches: &mut Vec<usize>) {
+ fn matches_into(
+ &self,
+ candidate: &Candidate<'_>,
+ matches: &mut Vec<usize>,
+ ) {
if candidate.basename.is_empty() {
return;
}
@@ -644,7 +646,11 @@ impl ExtensionStrategy {
}
#[inline(never)]
- fn matches_into(&self, candidate: &Candidate<'_>, matches: &mut Vec<usize>) {
+ fn matches_into(
+ &self,
+ candidate: &Candidate<'_>,
+ matches: &mut Vec<usize>,
+ ) {
if candidate.ext.is_empty() {
return;
}
@@ -672,7 +678,11 @@ impl PrefixStrategy {
false
}
- fn matches_into(&self, candidate: &Candidate<'_>, matches: &mut Vec<usize>) {
+ fn matches_into(
+ &self,
+ candidate: &Candidate<'_>,
+ matches: &mut Vec<usize>,
+ ) {
let path = candidate.path_prefix(self.longest);
for m in self.matcher.find_overlapping_iter(path) {
if m.start() == 0 {
@@ -700,7 +710,11 @@ impl SuffixStrategy {
false
}
- fn matches_into(&self, candidate: &Candidate<'_>, matches: &mut Vec<usize>) {
+ fn matches_into(
+ &self,
+ candidate: &Candidate<'_>,
+ matches: &mut Vec<usize>,
+ ) {
let path = candidate.path_suffix(self.longest);
for m in self.matcher.find_overlapping_iter(path) {
if m.end() == path.len() {
@@ -732,7 +746,11 @@ impl RequiredExtensionStrategy {
}
#[inline(never)]
- fn matches_into(&self, candidate: &Candidate<'_>, matches: &mut Vec<usize>) {
+ fn matches_into(
+ &self,
+ candidate: &Candidate<'_>,
+ matches: &mut Vec<usize>,
+ ) {
if candidate.ext.is_empty() {
return;
}
@@ -757,7 +775,11 @@ impl RegexSetStrategy {
self.matcher.is_match(candidate.path.as_bytes())
}
- fn matches_into(&self, candidate: &Candidate<'_>, matches: &mut Vec<usize>) {
+ fn matches_into(
+ &self,
+ candidate: &Candidate<'_>,
+ matches: &mut Vec<usize>,
+ ) {
for i in self.matcher.matches(candidate.path.as_bytes()) {
matches.push(self.map[i]);
}
diff --git a/crates/grep/README.md b/crates/grep/README.md
index b9df4dc0..41071ff0 100644
--- a/crates/grep/README.md
+++ b/crates/grep/README.md
@@ -26,12 +26,6 @@ Add this to your `Cargo.toml`:
grep = "0.2"
```
-and this to your crate root:
-
-```rust
-extern crate grep;
-```
-
### Features
diff --git a/crates/ignore/README.md b/crates/ignore/README.md
index d9213ec6..72258e6b 100644
--- a/crates/ignore/README.md
+++ b/crates/ignore/README.md
@@ -22,12 +22,6 @@ Add this to your `Cargo.toml`:
ignore = "0.4"
```
-and this to your crate root:
-
-```rust
-extern crate ignore;
-```
-
### Example
This example shows the most basic usage of this crate. This code will
diff --git a/crates/ignore/examples/walk.rs b/crates/ignore/examples/walk.rs
index 969bd1cb..e064478c 100644
--- a/crates/ignore/examples/walk.rs
+++ b/crates/ignore/examples/walk.rs
@@ -1,7 +1,3 @@
-extern crate crossbeam_channel as channel;
-use ignore;
-use walkdir;
-
use std::env;
use std::io::{self, Write};
use std::path::Path;
@@ -14,7 +10,7 @@ fn main() {
let mut path = env::args().nth(1).unwrap();
let mut parallel = false;
let mut simple = false;
- let (tx, rx) = channel::bounded::<DirEntry>(100);
+ let (tx, rx) = crossbeam_channel::bounded::<DirEntry>(100);
if path == "parallel" {
path = env::args().nth(2).unwrap();
parallel = true;
diff --git a/crates/ignore/src/dir.rs b/crates/ignore/src/dir.rs
index 18ab9abf..09414e9a 100644
--- a/crates/ignore/src/dir.rs
+++ b/crates/ignore/src/dir.rs
@@ -581,7 +581,7 @@ impl IgnoreBuilder {
.unwrap();
let (gi, err) = builder.build_global();
if let Some(err) = err {
- debug!("{}", err);
+ log::debug!("{}", err);
}
gi
};
diff --git a/crates/ignore/src/gitignore.rs b/crates/ignore/src/gitignore.rs
index 6eea9c4a..7922651c 100644
--- a/crates/ignore/src/gitignore.rs
+++ b/crates/ignore/src/gitignore.rs
@@ -592,7 +592,7 @@ fn parse_excludes_file(data: &[u8]) -> Option<PathBuf> {
// N.B. This is the lazy approach, and isn't technically correct, but
// probably works in more circumstances. I guess we would ideally have
// a full INI parser. Yuck.
- lazy_static! {
+ lazy_static::lazy_static! {
static ref RE: Regex =
Regex::new(r"(?im)^\s*excludesfile\s*=\s*(.+)\s*$").unwrap();
};
diff --git a/crates/ignore/src/lib.rs b/crates/ignore/src/lib.rs
index 3c82231d..824f7c4d 100644
--- a/crates/ignore/src/lib.rs
+++ b/crates/ignore/src/lib.rs
@@ -46,19 +46,6 @@ See the documentation for `WalkBuilder` for many other options.
#![deny(missing_docs)]
-
-#[macro_use]
-extern crate lazy_static;
-#[macro_use]
-extern crate log;
-
-
-
-
-use walkdir;
-#[cfg(windows)]
-extern crate winapi_util;
-
use std::error;
use std::fmt;
use std::io;
diff --git a/crates/ignore/src/types.rs b/crates/ignore/src/types.rs
index 62275b40..efb9a8d9 100644
--- a/crates/ignore/src/types.rs
+++ b/crates/ignore/src/types.rs
@@ -427,7 +427,7 @@ impl TypesBuilder {
/// If `name` is `all` or otherwise contains any character that is not a
/// Unicode letter or number, then an error is returned.
pub fn add(&mut self, name: &str, glob: &str) -> Result<(), Error> {
- lazy_static! {
+ lazy_static::lazy_static! {
static ref RE: Regex = Regex::new(r"^[\pL\pN]+$").unwrap();
};
if name == "all" || !RE.is_match(name) {
diff --git a/crates/ignore/src/walk.rs b/crates/ignore/src/walk.rs
index fac8c279..b381197e 100644
--- a/crates/ignore/src/walk.rs
+++ b/crates/ignore/src/walk.rs
@@ -1725,7 +1725,7 @@ fn skip_filesize(
if let Some(fs) = filesize {
if fs > max_filesize {
- debug!("ignoring {}: {} bytes", path.display(), fs);
+ log::debug!("ignoring {}: {} bytes", path.display(), fs);
true
} else {
false
@@ -1738,10 +1738,10 @@ fn skip_filesize(
fn should_skip_entry(ig: &Ignore, dent: &DirEntry) -> bool {
let m = ig.matched_dir_entry(dent);
if m.is_ignore() {
- debug!("ignoring {}: {:?}", dent.path().display(), m);
+ log::debug!("ignoring {}: {:?}", dent.path().display(), m);
true
} else if m.is_whitelist() {
- debug!("whitelisting {}: {:?}", dent.path().display(), m);
+ log::debug!("whitelisting {}: {:?}", dent.path().display(), m);
false
} else {
false
diff --git a/crates/matcher/README.md b/crates/matcher/README.md
index dc77ecff..e521d937 100644
--- a/crates/matcher/README.md
+++ b/crates/matcher/README.md
@@ -27,9 +27,3 @@ Add this to your `Cargo.toml`:
[dependencies]
grep-matcher = "0.1"
```
-
-and this to your crate root:
-
-```rust
-extern crate grep_matcher;
-```
diff --git a/crates/pcre2/README.md b/crates/pcre2/README.md
index 68350676..43dff166 100644
--- a/crates/pcre2/README.md
+++ b/crates/pcre2/README.md
@@ -30,9 +30,3 @@ Add this to your `Cargo.toml`:
[dependencies]
grep-pcre2 = "0.1"
```
-
-and this to your crate root:
-
-```rust
-extern crate grep_pcre2;
-```
diff --git a/crates/printer/Cargo.toml b/crates/printer/Cargo.toml
index 05e601d2..375451d2 100644
--- a/crates/printer/Cargo.toml
+++ b/crates/printer/Cargo.toml
@@ -16,7 +16,7 @@ edition = "2018"
[features]
default = ["serde1"]
-serde1 = ["base64", "serde", "serde_derive", "serde_json"]
+serde1 = ["base64", "serde", "serde_json"]
[dependencies]
base64 = { version = "0.13.0", optional = true }
@@ -24,8 +24,7 @@ bstr = "0.2.0"
grep-matcher = { version = "0.1.2", path = "../matcher" }
grep-searcher = { version = "0.1.4", path = "../searcher" }
termcolor = "1.0.4"
-serde = { version = "1.0.77", optional = true }
-serde_derive = { version = "1.0.77", optional = true }
+serde = { version = "1.0.77", optional = true, features = ["derive"] }
serde_json = { version = "1.0.27", optional = true }
[dev-dependencies]
diff --git a/crates/printer/README.md b/crates/printer/README.md
index a0b3653f..869fbd5f 100644
--- a/crates/printer/README.md
+++ b/crates/printer/README.md
@@ -26,9 +26,3 @@ Add this to your `Cargo.toml`:
[dependencies]
grep-printer = "0.1"
```
-
-and this to your crate root:
-
-```rust
-extern crate grep_printer;
-```
diff --git a/crates/printer/src/color.rs b/crates/printer/src/color.rs
index d1a970ea..11d2c3e6 100644
--- a/crates/printer/src/color.rs
+++ b/crates/printer/src/color.rs
@@ -147,9 +147,6 @@ pub struct ColorSpecs {
/// A `UserColorSpec` can also be converted to a `termcolor::ColorSpec`:
///
/// ```rust
-/// extern crate grep_printer;
-/// extern crate termcolor;
-///
/// # fn main() {
/// use termcolor::{Color, ColorSpec};
/// use grep_printer::UserColorSpec;
diff --git a/crates/printer/src/lib.rs b/crates/printer/src/lib.rs
index 04f4cf21..29e0a45b 100644
--- a/crates/printer/src/lib.rs
+++ b/crates/printer/src/lib.rs
@@ -27,10 +27,6 @@ contain matches.
This example shows how to create a "standard" printer and execute a search.
```
-extern crate grep_regex;
-extern crate grep_printer;
-extern crate grep_searcher;
-
use std::error::Error;
use grep_regex::RegexMatcher;
@@ -68,20 +64,6 @@ fn example() -> Result<(), Box<Error>> {
#![deny(missing_docs)]
-#[cfg(feature = "serde1")]
-extern crate base64;
-
-
-
-
-
-#[cfg(feature = "serde1")]
-#[macro_use]
-extern crate serde_derive;
-#[cfg(feature = "serde1")]
-extern crate serde_json;
-
-
pub use crate::color::{
default_color_specs, ColorError, ColorSpecs, UserColorSpec,
};
diff --git a/crates/printer/src/stats.rs b/crates/printer/src/stats.rs
index c06ab3fd..357b9a77 100644
--- a/crates/printer/src/stats.rs
+++ b/crates/printer/src/stats.rs
@@ -8,7 +8,7 @@ use crate::util::NiceDuration;
/// When statistics are reported by a printer, they correspond to all searches
/// executed with that printer.
#[derive(Clone, Debug, Default, PartialEq, Eq)]
-#[cfg_attr(feature = "serde1", derive(Serialize))]
+#[cfg_attr(feature = "serde1", derive(serde::Serialize))]
pub struct Stats {
elapsed: NiceDuration,
searches: u64,
diff --git a/crates/regex/README.md b/crates/regex/README.md
index bd51df77..75029bfc 100644
--- a/crates/regex/README.md
+++ b/crates/regex/README.md
@@ -26,9 +26,3 @@ Add this to your `Cargo.toml`:
[dependencies]
grep-regex = "0.1"
```
-
-and this to your crate root:
-
-```rust
-extern crate grep_regex;
-```
diff --git a/crates/regex/src/lib.rs b/crates/regex/src/lib.rs
index aae98809..e83b4361 100644
--- a/crates/regex/src/lib.rs
+++ b/crates/regex/src/lib.rs
@@ -1,18 +1,8 @@
/*!
An implementation of `grep-matcher`'s `Matcher` trait for Rust's regex engine.
*/
-
#![deny(missing_docs)]
-
-
-
-#[macro_use]
-extern crate log;
-
-
-
-
pub use crate::error::{Error, ErrorKind};
pub use crate::matcher::{RegexCaptures, RegexMatcher, RegexMatcherBuilder};
diff --git a/crates/regex/src/literal.rs b/crates/regex/src/literal.rs
index 7a6d92d9..db5ed3b7 100644
--- a/crates/regex/src/literal.rs
+++ b/crates/regex/src/literal.rs
@@ -55,7 +55,7 @@ impl LiteralSets {
if !word {
if self.prefixes.all_complete() && !self.prefixes.is_empty() {
- debug!("literal prefixes detected: {:?}", self.prefixes);
+ log::debug!("literal prefixes detected: {:?}", self.prefixes);
// When this is true, the regex engine will do a literal scan,
// so we don't need to return anything. But we only do this
// if we aren't doing a word regex, since a word regex adds
@@ -106,7 +106,7 @@ impl LiteralSets {
&& !any_empty
&& !any_white
{
- debug!("required literals found: {:?}", req_lits);
+ log::debug!("required literals found: {:?}", req_lits);
let alts: Vec<String> = req_lits
.into_iter()
.map(|x| util::bytes_to_regex(x))
@@ -149,27 +149,27 @@ impl LiteralSets {
let lits = match (p_min_len, s_min_len) {
(None, None) => return None,
(Some(_), None) => {
- debug!("prefix literals found");
+ log::debug!("prefix literals found");
self.prefixes.literals()
}
(None, Some(_)) => {
- debug!("suffix literals found");
+ log::debug!("suffix literals found");
self.suffixes.literals()
}
(Some(p), Some(s)) => {
if p >= s {
- debug!("prefix literals found");
+ log::debug!("prefix literals found");
self.prefixes.literals()
} else {
- debug!("suffix literals found");
+ log::debug!("suffix literals found");
self.suffixes.literals()
}
}
};
- debug!("prefix/suffix literals found: {:?}", lits);
+ log::debug!("prefix/suffix literals found: {:?}", lits);
if has_only_whitespace(lits) {
- debug!("dropping literals because one was whitespace");
+ log::debug!("dropping literals because one was whitespace");
return None;
}
let alts: Vec<String> =
@@ -177,9 +177,9 @@ impl LiteralSets {
// We're matching raw bytes, so disable Unicode mode.
Some(format!("(?-u:{})", alts.join("|")))
} else {
- debug!("required literal found: {:?}", util::show_bytes(lit));
+ log::debug!("required literal found: {:?}", util::show_bytes(lit));
if lit.chars().all(|c| c.is_whitespace()) {
- debug!("dropping literal because one was whitespace");
+ log::debug!("dropping literal because one was whitespace");
return None;
}
Some(format!("(?-u:{})", util::bytes_to_regex(&lit)))
diff --git a/crates/regex/src/matcher.rs b/crates/regex/src/matcher.rs
index cb7749c8..92ef5c76 100644
--- a/crates/regex/src/matcher.rs
+++ b/crates/regex/src/matcher.rs
@@ -47,11 +47,11 @@ impl RegexMatcherBuilder {
let fast_line_regex = chir.fast_line_regex()?;
let non_matching_bytes = chir.non_matching_bytes();
if let Some(ref re) = fast_line_regex {
- debug!("extracted fast line regex: {:?}", re);
+ log::debug!("extracted fast line regex: {:?}", re);
}
let matcher = RegexMatcherImpl::new(&chir)?;
- trace!("final regex: {:?}", matcher.regex());
+ log::trace!("final regex: {:?}", matcher.regex());
Ok(RegexMatcher {
config: self.config.clone(),
matcher,
diff --git a/crates/regex/src/word.rs b/crates/regex/src/word.rs
index 61b7e0f9..d73dd6ca 100644
--- a/crates/regex/src/word.rs
+++ b/crates/regex/src/word.rs
@@ -49,7 +49,7 @@ impl WordMatcher {
expr.with_pattern(|pat| format!("^(?:{})$", pat))?.regex()?;
let word_expr = expr.with_pattern(|pat| {
let pat = format!(r"(?:(?m:^)|\W)({})(?:\W|(?m:$))", pat);
- debug!("word regex: {:?}", pat);
+ log::debug!("word regex: {:?}", pat);
pat
})?;
let regex = word_expr.regex()?;
diff --git a/crates/searcher/README.md b/crates/searcher/README.md
index 67a45a89..e6206556 100644
--- a/crates/searcher/README.md
+++ b/crates/searcher/README.md
@@ -28,9 +28,3 @@ Add this to your `Cargo.toml`:
[dependencies]
grep-searcher = "0.1"
```
-
-and this to your crate root:
-
-```rust
-extern crate grep_searcher;
-```
diff --git a/crates/searcher/src/lib.rs b/crates/searcher/src/lib.rs
index 49c7e2a4..f6a96a21 100644
--- a/crates/searcher/src/lib.rs
+++ b/crates