summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Peter <mail@david-peter.de>2021-11-26 19:43:36 +0100
committerDavid Peter <sharkdp@users.noreply.github.com>2021-11-26 21:23:47 +0100
commitf219da4b3a9af4139098502486bae1cc38c1a2a7 (patch)
treee47319149187d43a642652794eca31854b5ab1d2
parente990a13405883581e174d484a9f55c7451023bd1 (diff)
Use non-sync channel
-rw-r--r--src/walk.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/walk.rs b/src/walk.rs
index f0cee6d..8a1f291 100644
--- a/src/walk.rs
+++ b/src/walk.rs
@@ -3,7 +3,7 @@ use std::fs::{FileType, Metadata};
use std::io;
use std::path::{Path, PathBuf};
use std::sync::atomic::{AtomicBool, Ordering};
-use std::sync::mpsc::{sync_channel, Receiver, SyncSender as Sender};
+use std::sync::mpsc::{channel, Receiver, Sender};
use std::sync::{Arc, Mutex};
use std::thread;
use std::time;
@@ -22,12 +22,6 @@ use crate::exit_codes::{merge_exitcodes, ExitCode};
use crate::filesystem;
use crate::output;
-pub const WORKER_CHANNEL_DEFAULT_BOUND: usize = 1000;
-
-pub fn make_worker_channel() -> (Sender<WorkerResult>, Receiver<WorkerResult>) {
- sync_channel(WORKER_CHANNEL_DEFAULT_BOUND)
-}
-
/// The receiver thread can either be buffering results or directly streaming to the console.
enum ReceiverMode {
/// Receiver is still buffering in order to sort the results, if the search finishes fast
@@ -59,7 +53,7 @@ pub fn scan(path_vec: &[PathBuf], pattern: Arc<Regex>, config: Arc<Config>) -> R
let first_path_buf = path_iter
.next()
.expect("Error: Path vector can not be empty");
- let (tx, rx) = make_worker_channel();
+ let (tx, rx) = channel();
let mut override_builder = OverrideBuilder::new(first_path_buf.as_path());