use debug_struct instead of write!
This commit is contained in:
parent
7eb371729b
commit
8efda5e688
1 changed files with 3 additions and 6 deletions
|
|
@ -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
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue