mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-08-16 04:33:49 -07:00
edition: manual changes
This is mostly just about removing 'extern crate' everywhere and fixing the fallout.
This commit is contained in:
@@ -581,7 +581,7 @@ impl IgnoreBuilder {
|
||||
.unwrap();
|
||||
let (gi, err) = builder.build_global();
|
||||
if let Some(err) = err {
|
||||
debug!("{}", err);
|
||||
log::debug!("{}", err);
|
||||
}
|
||||
gi
|
||||
};
|
||||
|
@@ -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();
|
||||
};
|
||||
|
@@ -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;
|
||||
|
@@ -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) {
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user