From 5950d10d98409453b39c6ad4b381c7784cd26c9b Mon Sep 17 00:00:00 2001 From: Code002Lover Arch Laptop Date: Tue, 28 Feb 2023 09:04:07 +0100 Subject: [PATCH] add message instead of assert --- src/main.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 3ff7f62..41b0606 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,7 +21,9 @@ fn p(n: f64) -> f64 { fn main() { - assert!(set_current_thread_priority(ThreadPriority::Max).is_ok()); + if set_current_thread_priority(ThreadPriority::Max).is_err() { + eprintln!("failed to set thread priority to max"); + } /* let mut buffer = String::new(); @@ -55,7 +57,9 @@ fn main() { let arcclone = primearc.clone(); let tprimes = thread::spawn(move || { - assert!(set_current_thread_priority(ThreadPriority::Max).is_ok()); + if set_current_thread_priority(ThreadPriority::Max).is_err() { + eprintln!("failed to set thread priority to max"); + } let one_thousand = &BigUint::from(1_000u16); let one_hundred = &BigUint::from(100u8);