use debug_struct instead of write!

This commit is contained in:
Craig Watson 2025-06-03 09:28:15 -07:00
parent 7eb371729b
commit 8efda5e688

View file

@ -279,12 +279,9 @@ impl<T> Task<T> {
impl<T> std::fmt::Debug for Task<T> { impl<T> std::fmt::Debug for Task<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!( f.debug_struct(&format!("Task<{}>", std::any::type_name::<T>()))
f, .field("units", &self.units)
"Task<{}>, units={}", .finish()
std::any::type_name::<T>(),
self.units
)
} }
} }