summaryrefslogtreecommitdiffstats
path: root/crates/cli
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 /crates/cli
parentaf54069c51cc3656c9c343a7fb3c9360cfddf505 (diff)
edition: manual changes
This is mostly just about removing 'extern crate' everywhere and fixing the fallout.
Diffstat (limited to 'crates/cli')
-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
5 files changed, 4 insertions, 17 deletions
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);
}
}
}