diff --git a/src/lib/lib.rs b/src/lib/lib.rs index bb9d81c..50b0639 100644 --- a/src/lib/lib.rs +++ b/src/lib/lib.rs @@ -9,14 +9,14 @@ use std::time::Instant; const USER_NAME: &str = "Jonah"; -pub fn compute_async(mut function: impl FnMut(Sender<(T, T)>) + Send + 'static) { +pub fn compute_async(mut function: impl FnMut(Sender<(T, T)>) -> R + Send + 'static ) -> R { let (tx, jh1) = spawn_submission_thread(); let jh2 = thread::spawn(move || { - function(tx); + function(tx) }); jh1.join().unwrap(); - jh2.join().unwrap(); + jh2.join().unwrap() } pub fn spawn_submission_thread() -> (Sender<(T, T)>, JoinHandle<()>) {