Merge pull request #229 from jonathandturner/better_short_names

Change list/object to better short names
This commit is contained in:
Jonathan Turner 2019-07-30 14:10:37 +12:00 committed by GitHub
commit 7b548026a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -477,8 +477,12 @@ impl Value {
.map(|e| e.source(&b.source).to_string()), .map(|e| e.source(&b.source).to_string()),
"; ", "; ",
), ),
Value::Object(_) => format!("[object Object]"), Value::Object(_) => format!("[{}]", self.type_name()),
Value::List(_) => format!("[list List]"), Value::List(l) => format!(
"[{} {}]",
l.len(),
if l.len() == 1 { "item" } else { "items" }
),
Value::Binary(_) => format!("<binary>"), Value::Binary(_) => format!("<binary>"),
} }
} }