From aed49466cebea3c4ef57241a76a816234bf71390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20M=C3=BCller?= Date: Tue, 6 Jun 2023 20:13:07 +0200 Subject: [PATCH] fixed format in "multithreading" and "lib" --- .gitignore | 1 + benches/multithreading.rs | 3 +-- src/lib.rs | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 98f2979..7cd589f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /target /Cargo.lock .DS_Store +.idea /.vscode \ No newline at end of file diff --git a/benches/multithreading.rs b/benches/multithreading.rs index 20ce75e..4f9c642 100644 --- a/benches/multithreading.rs +++ b/benches/multithreading.rs @@ -37,7 +37,6 @@ fn dot(a: &[f64], b: &[f64]) -> f64 { /// sized slices which then get passed ot their own thread to compute the partial dot product. After all threads have /// finished the partial dot products will be summed to create the final result. fn dot_parallel(a: Arc>, b: Arc>, threads: usize) { - let mut pool = ThreadPool::with_limit(threads); // number of elements in each vector for each thread @@ -56,7 +55,7 @@ fn dot_parallel(a: Arc>, b: Arc>, threads: usize) { dot(a, b) }); } - + pool.join_all(); black_box(pool.get_results().iter().sum::()); diff --git a/src/lib.rs b/src/lib.rs index 35a42fb..2b26d05 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,3 @@ - extern crate core; pub mod image;