summaryrefslogtreecommitdiff
path: root/src/eval/dict.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-08-31 16:25:12 +0200
committerLaurenz <laurmaedje@gmail.com>2021-08-31 16:25:12 +0200
commit7f48e8fe6668c5b2fdc62cc70e6bcffb744f411c (patch)
tree6ec437098d9f6df511cfbc0805ac51af288c4eec /src/eval/dict.rs
parent3481d8cc81a2b3a14118869c7f0ffe204ff3efc8 (diff)
Make user-facing "debug" representation use Debug instead of Display
Diffstat (limited to 'src/eval/dict.rs')
-rw-r--r--src/eval/dict.rs12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/eval/dict.rs b/src/eval/dict.rs
index dfac04ed..c0ddf328 100644
--- a/src/eval/dict.rs
+++ b/src/eval/dict.rs
@@ -1,5 +1,5 @@
use std::collections::BTreeMap;
-use std::fmt::{self, Debug, Display, Formatter, Write};
+use std::fmt::{self, Debug, Formatter, Write};
use std::iter::FromIterator;
use std::ops::{Add, AddAssign};
use std::rc::Rc;
@@ -79,17 +79,11 @@ impl Dict {
/// The missing key access error message.
#[cold]
fn missing_key(key: &Str) -> String {
- format!("dictionary does not contain key: {}", key)
+ format!("dictionary does not contain key: {:?}", key)
}
impl Debug for Dict {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
- f.debug_map().entries(self.0.iter()).finish()
- }
-}
-
-impl Display for Dict {
- fn fmt(&self, f: &mut Formatter) -> fmt::Result {
f.write_char('(')?;
if self.is_empty() {
f.write_char(':')?;
@@ -97,7 +91,7 @@ impl Display for Dict {
for (i, (key, value)) in self.iter().enumerate() {
f.write_str(key)?;
f.write_str(": ")?;
- Display::fmt(value, f)?;
+ value.fmt(f)?;
if i + 1 < self.0.len() {
f.write_str(", ")?;
}