mirror of
https://github.com/Chaoscaot/schemsearch.git
synced 2025-11-05 05:54:02 +01:00
Add Progressbar
This commit is contained in:
@ -15,6 +15,7 @@ clap = { version = "4.1.8", features = ["cargo"] }
|
||||
futures = { version = "0.3", optional = true }
|
||||
sqlx = { version = "0.6", features = [ "runtime-async-std-native-tls" , "mysql" ], optional = true }
|
||||
rayon = "1.7.0"
|
||||
indicatif = { version = "0.17.3", features = ["rayon"] }
|
||||
|
||||
[features]
|
||||
sql = ["dep:schemsearch-sql", "dep:futures", "dep:sqlx"]
|
||||
|
||||
@ -36,6 +36,7 @@ use schemsearch_sql::filter::SchematicFilter;
|
||||
use schemsearch_sql::load_all_schematics;
|
||||
#[cfg(feature = "sql")]
|
||||
use crate::types::SqlSchematicSupplier;
|
||||
use indicatif::{ProgressBar, ParallelProgressIterator, ProgressStyle};
|
||||
|
||||
fn main() {
|
||||
#[allow(unused_mut)]
|
||||
@ -256,7 +257,7 @@ fn main() {
|
||||
}
|
||||
ThreadPoolBuilder::new().num_threads(*matches.get_one::<usize>("threads").expect("Could not get threads")).build_global().unwrap();
|
||||
|
||||
let matches: Vec<Result> = schematics.par_iter().map(|schem| {
|
||||
let matches: Vec<Result> = schematics.par_iter().progress_with_style(ProgressStyle::default_bar()).map(|schem| {
|
||||
match schem {
|
||||
SchematicSupplierType::PATH(schem) => {
|
||||
let schematic = match load_schem(&schem.path) {
|
||||
|
||||
Reference in New Issue
Block a user