Skip to content
This repository was archived by the owner on Apr 2, 2025. It is now read-only.

Commit ccedbd5

Browse files
author
Vanessa McHale
committed
bump crossbeam
1 parent e711dad commit ccedbd5

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ version = "2.29.2"
2626

2727
[dependencies]
2828
colored = "1.6.0"
29-
crossbeam = "0.4.1"
29+
crossbeam = "0.5.0"
3030
glob = "0.2.11"
3131
lazy_static = "1.0.0"
3232
nom = "3.2"

src/walk_parallel/mod.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ extern crate walkdir;
44
pub mod single_threaded;
55

66
use self::crossbeam::deque::fifo;
7+
use self::crossbeam::deque::Pop;
8+
use self::crossbeam::deque::Steal;
79
use self::crossbeam::deque::Worker;
810
use self::walkdir::WalkDir;
911
use colored::*;
@@ -375,11 +377,11 @@ pub fn print_parallel(w: Walk) -> () {
375377

376378
// start popping off values in the worker's thread
377379
loop {
378-
if let Some(p) = worker.pop() {
380+
if let Pop::Data(p) = worker.pop() {
379381
match p {
380382
Status::Data(d) => Walk::print_dir(&d, &arc_local),
381383
_ => break,
382-
};
384+
}
383385
}
384386
}
385387
});
@@ -397,11 +399,11 @@ pub fn print_parallel(w: Walk) -> () {
397399

398400
// run the stealer in a new thread
399401
let child_consumer = thread::spawn(move || loop {
400-
if let Some(p) = stealer_clone.steal() {
402+
if let Steal::Data(p) = stealer_clone.steal() {
401403
match p {
402404
Status::Data(d) => Walk::print_dir(&d, &arc_local),
403405
_ => break,
404-
};
406+
}
405407
}
406408
});
407409

0 commit comments

Comments
 (0)