Compare commits

...

5 Commits

Author SHA1 Message Date
Andrew Gallant
3224324e25 grep-cli-0.1.7 2023-01-05 08:57:31 -05:00
Andrew Gallant
0f61f08eb1 deps: update to ignore 0.4.19 2023-01-05 08:57:05 -05:00
Andrew Gallant
a0e8dbe9df ignore-0.4.19 2023-01-05 08:55:46 -05:00
Andrew Gallant
e95254a86f deps: remove ignore's dependency on crossbeam-utils
Scoped threads are now part of std.
2023-01-05 08:51:08 -05:00
Andrew Gallant
2f484d8ce5 deps: update to globset 0.4.10 2023-01-05 08:49:58 -05:00
5 changed files with 10 additions and 13 deletions

5
Cargo.lock generated
View File

@@ -166,7 +166,7 @@ dependencies = [
[[package]] [[package]]
name = "grep-cli" name = "grep-cli"
version = "0.1.6" version = "0.1.7"
dependencies = [ dependencies = [
"atty", "atty",
"bstr", "bstr",
@@ -248,10 +248,9 @@ dependencies = [
[[package]] [[package]]
name = "ignore" name = "ignore"
version = "0.4.18" version = "0.4.19"
dependencies = [ dependencies = [
"crossbeam-channel", "crossbeam-channel",
"crossbeam-utils",
"globset", "globset",
"lazy_static", "lazy_static",
"log", "log",

View File

@@ -44,7 +44,7 @@ members = [
[dependencies] [dependencies]
bstr = "1.1.0" bstr = "1.1.0"
grep = { version = "0.2.8", path = "crates/grep" } grep = { version = "0.2.8", path = "crates/grep" }
ignore = { version = "0.4.18", path = "crates/ignore" } ignore = { version = "0.4.19", path = "crates/ignore" }
lazy_static = "1.1.0" lazy_static = "1.1.0"
log = "0.4.5" log = "0.4.5"
regex = "1.3.5" regex = "1.3.5"

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "grep-cli" name = "grep-cli"
version = "0.1.6" #:version version = "0.1.7" #:version
authors = ["Andrew Gallant <jamslam@gmail.com>"] authors = ["Andrew Gallant <jamslam@gmail.com>"]
description = """ description = """
Utilities for search oriented command line applications. Utilities for search oriented command line applications.
@@ -16,7 +16,7 @@ edition = "2018"
[dependencies] [dependencies]
atty = "0.2.11" atty = "0.2.11"
bstr = "1.1.0" bstr = "1.1.0"
globset = { version = "0.4.9", path = "../globset" } globset = { version = "0.4.10", path = "../globset" }
lazy_static = "1.1.0" lazy_static = "1.1.0"
log = "0.4.5" log = "0.4.5"
regex = "1.1" regex = "1.1"

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "ignore" name = "ignore"
version = "0.4.18" #:version version = "0.4.19" #:version
authors = ["Andrew Gallant <jamslam@gmail.com>"] authors = ["Andrew Gallant <jamslam@gmail.com>"]
description = """ description = """
A fast library for efficiently matching ignore files such as `.gitignore` A fast library for efficiently matching ignore files such as `.gitignore`
@@ -19,8 +19,7 @@ name = "ignore"
bench = false bench = false
[dependencies] [dependencies]
crossbeam-utils = "0.8.0" globset = { version = "0.4.10", path = "../globset" }
globset = { version = "0.4.9", path = "../globset" }
lazy_static = "1.1" lazy_static = "1.1"
log = "0.4.5" log = "0.4.5"
memchr = "2.1" memchr = "2.1"

View File

@@ -1282,7 +1282,7 @@ impl WalkParallel {
let quit_now = Arc::new(AtomicBool::new(false)); let quit_now = Arc::new(AtomicBool::new(false));
let num_pending = let num_pending =
Arc::new(AtomicUsize::new(stack.lock().unwrap().len())); Arc::new(AtomicUsize::new(stack.lock().unwrap().len()));
crossbeam_utils::thread::scope(|s| { std::thread::scope(|s| {
let mut handles = vec![]; let mut handles = vec![];
for _ in 0..threads { for _ in 0..threads {
let worker = Worker { let worker = Worker {
@@ -1296,13 +1296,12 @@ impl WalkParallel {
skip: self.skip.clone(), skip: self.skip.clone(),
filter: self.filter.clone(), filter: self.filter.clone(),
}; };
handles.push(s.spawn(|_| worker.run())); handles.push(s.spawn(|| worker.run()));
} }
for handle in handles { for handle in handles {
handle.join().unwrap(); handle.join().unwrap();
} }
}) });
.unwrap(); // Pass along panics from threads
} }
fn threads(&self) -> usize { fn threads(&self) -> usize {