Skip to content

Commit

Permalink
Make clear it's a JsValue.
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-uk1 committed Jan 11, 2019
1 parent 8b1839f commit e783639
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,8 @@ impl Clone for JsValue {
#[cfg(feature = "std")]
impl fmt::Debug for JsValue {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(&self.as_debug_string())
use std::fmt::Write;
write!(f, "JsValue({})", self.as_debug_string())
}
}

Expand All @@ -538,7 +539,7 @@ impl fmt::Debug for JsValue {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
// TODO before merge - this is less info than before - is this OK? Can we do the above
// without using allocation (no_std)?
f.write_str("[object]")
f.write_str("JsValue(..)")
}
}

Expand Down

0 comments on commit e783639

Please sign in to comment.