From 8cf5a8a9b49218a72e589cc84f269e57888a508f Mon Sep 17 00:00:00 2001 From: jbb01 <32650546+jbb01@users.noreply.github.com> Date: Wed, 10 Sep 2025 11:41:24 +0200 Subject: [PATCH] add return value to compute_async --- src/lib/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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<()>) {