From 8fd771354260e2d2c9f0453091db98eec4ad8482 Mon Sep 17 00:00:00 2001 From: Alex Pyattaev Date: Fri, 10 Jan 2025 03:44:08 +0300 Subject: [PATCH] Better panic message formatting Co-authored-by: Andrew Fitzgerald --- thread-manager/src/policy.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/thread-manager/src/policy.rs b/thread-manager/src/policy.rs index d2ca08e392899c..0065987bfea133 100644 --- a/thread-manager/src/policy.rs +++ b/thread-manager/src/policy.rs @@ -43,13 +43,13 @@ pub fn set_thread_affinity(cores: &[usize]) { ); if let Err(e) = affinity::set_thread_affinity(cores) { let thread = std::thread::current(); - let msg = format!( - "Can not set core affinity {:?} for thread {:?} named {:?}, error {e}", + panic!( + "Can not set core affinity {:?} for thread {:?} named {:?}, error {}", cores, thread.id(), - thread.name() + thread.name(), + e ); - panic!("{}", msg); } }