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() } }