edition: manual changes

This is mostly just about removing 'extern crate' everywhere and fixing
the fallout.
This commit is contained in:
Andrew Gallant
2021-06-01 20:45:45 -04:00
parent af54069c51
commit e824531e38
34 changed files with 93 additions and 182 deletions

View File

@@ -581,7 +581,7 @@ impl IgnoreBuilder {
.unwrap();
let (gi, err) = builder.build_global();
if let Some(err) = err {
debug!("{}", err);
log::debug!("{}", err);
}
gi
};

View File

@@ -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();
};

View File

@@ -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;

View File

@@ -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) {

View File

@@ -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