From 88a268e646b0b0cbce91e6fba21e02650f8f099e Mon Sep 17 00:00:00 2001 From: trivernis Date: Fri, 6 Mar 2020 20:47:09 +0100 Subject: [PATCH] Revert back to sync channels with bigger buffer --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index ec7601f..29e9757 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,7 +13,7 @@ use spinners::{Spinner, Spinners}; use std::fs; use std::fs::File; use std::io::{BufWriter, Write}; -use std::sync::mpsc::channel; +use std::sync::mpsc::sync_channel; use std::thread; use std::time::Duration; use structopt::StructOpt; @@ -185,7 +185,7 @@ fn create_dictionary(_opts: &Opts, args: &CreateDictionary) { pb = ProgressBar::new(lines.clone().count() as u64); } pb.set_max_refresh_rate(Some(Duration::from_millis(200))); - let (rx, tx) = channel::(); + let (rx, tx) = sync_channel::(100_000_000); handle = thread::spawn(move || { for line in tx { writer.write(&line.as_bytes()).unwrap();