| 252 | } |
| 253 | |
| 254 | fn append_reprs<'b>(&self, out: &mut String, it: impl Iterator<Item = &'b Val>, seen: &mut Vec<u32>) { |
| 255 | let mut first = true; |
| 256 | for v in it { |
| 257 | // Bound breadth: a wide structure re-referencing one big child would render without limit. |
| 258 | if out.len() > MAX_REPR_LEN { out.push_str(", ..."); break; } |
| 259 | if !first { out.push_str(", "); } |
| 260 | out.push_str(&self.repr_d(*v, seen)); |
| 261 | first = false; |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | pub fn display(&self, v: Val) -> String { self.display_d(v, &mut Vec::new()) } |
| 266 | |