diff --git a/src/any.rs b/src/any.rs index 5182da08..8ff20298 100644 --- a/src/any.rs +++ b/src/any.rs @@ -243,12 +243,15 @@ impl fmt::Display for Dynamic { #[cfg(not(feature = "no_index"))] Union::Array(value) => fmt::Debug::fmt(value, f), #[cfg(not(feature = "no_object"))] - Union::Map(value) => write!(f, "#{:?}", value), + Union::Map(value) => { + f.write_str("#")?; + fmt::Debug::fmt(value, f) + } Union::FnPtr(value) => fmt::Display::fmt(value, f), #[cfg(not(feature = "no_std"))] Union::Variant(value) if value.is::() => write!(f, ""), - Union::Variant(_) => write!(f, "?"), + Union::Variant(value) => write!(f, "{}", (*value).type_name()), } } } @@ -266,12 +269,15 @@ impl fmt::Debug for Dynamic { #[cfg(not(feature = "no_index"))] Union::Array(value) => fmt::Debug::fmt(value, f), #[cfg(not(feature = "no_object"))] - Union::Map(value) => write!(f, "#{:?}", value), + Union::Map(value) => { + f.write_str("#")?; + fmt::Debug::fmt(value, f) + } Union::FnPtr(value) => fmt::Display::fmt(value, f), #[cfg(not(feature = "no_std"))] Union::Variant(value) if value.is::() => write!(f, ""), - Union::Variant(_) => write!(f, ""), + Union::Variant(value) => write!(f, "{}", (*value).type_name()), } } }