From 8efda5e68835dfc192f60143b16e5c82dab37c5f Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Tue, 3 Jun 2025 09:28:15 -0700 Subject: [PATCH] use `debug_struct` instead of `write!` --- runtime/src/task.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/runtime/src/task.rs b/runtime/src/task.rs index a932a162..731c0be8 100644 --- a/runtime/src/task.rs +++ b/runtime/src/task.rs @@ -279,12 +279,9 @@ impl Task { impl std::fmt::Debug for Task { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!( - f, - "Task<{}>, units={}", - std::any::type_name::(), - self.units - ) + f.debug_struct(&format!("Task<{}>", std::any::type_name::())) + .field("units", &self.units) + .finish() } }