diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e07fe18..c0b20648 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,15 @@ Rhai Release Notes ================== +Version 1.3.1 +============= + +Enhancements +------------ + +* `BLOB`'s are refined to display in a more compact hex format. + + Version 1.3.0 ============= diff --git a/src/types/dynamic.rs b/src/types/dynamic.rs index 9f142049..314dbc4b 100644 --- a/src/types/dynamic.rs +++ b/src/types/dynamic.rs @@ -689,7 +689,16 @@ impl fmt::Debug for Dynamic { #[cfg(not(feature = "no_index"))] Union::Array(ref value, _, _) => fmt::Debug::fmt(value, f), #[cfg(not(feature = "no_index"))] - Union::Blob(ref value, _, _) => fmt::Debug::fmt(value, f), + Union::Blob(ref value, _, _) => { + f.write_str("[")?; + value.iter().enumerate().try_for_each(|(i, v)| { + if i > 0 && i % 8 == 0 { + f.write_str(" ")?; + } + write!(f, "{:02x}", v) + })?; + f.write_str("]") + } #[cfg(not(feature = "no_object"))] Union::Map(ref value, _, _) => { f.write_str("#")?;