Revert to channels without a limit to speed up calculations again

master
trivernis 5 years ago
parent fa2ad327fc
commit edf97e204d

@ -13,7 +13,7 @@ use spinners::{Spinner, Spinners};
use std::fs; use std::fs;
use std::fs::File; use std::fs::File;
use std::io::{BufWriter, Write}; use std::io::{BufWriter, Write};
use std::sync::mpsc::sync_channel; use std::sync::mpsc::channel;
use std::thread; use std::thread;
use std::time::Duration; use std::time::Duration;
use structopt::StructOpt; use structopt::StructOpt;
@ -185,7 +185,7 @@ fn create_dictionary(_opts: &Opts, args: &CreateDictionary) {
pb = ProgressBar::new(lines.clone().count() as u64); pb = ProgressBar::new(lines.clone().count() as u64);
} }
pb.set_max_refresh_rate(Some(Duration::from_millis(200))); pb.set_max_refresh_rate(Some(Duration::from_millis(200)));
let (rx, tx) = sync_channel::<String>(10_000_000); let (rx, tx) = channel::<String>();
handle = thread::spawn(move || { handle = thread::spawn(move || {
for line in tx { for line in tx {
writer.write(&line.as_bytes()).unwrap(); writer.write(&line.as_bytes()).unwrap();

Loading…
Cancel
Save