diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-02-07 14:19:13 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-02-07 14:19:13 +0100 |
| commit | 9730e785a885a4ab5fcc52ce705298654f82f9c2 (patch) | |
| tree | fcc6c09caf473ad5845f12805d5c914a43f890e2 /src/frame.rs | |
| parent | 5d05c3f68a32c4214661a6807a5358865f54f0af (diff) | |
Tidy up
Diffstat (limited to 'src/frame.rs')
| -rw-r--r-- | src/frame.rs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/frame.rs b/src/frame.rs index f228fe56..7cc564cc 100644 --- a/src/frame.rs +++ b/src/frame.rs @@ -127,18 +127,17 @@ impl Frame { impl Debug for Frame { fn fmt(&self, f: &mut Formatter) -> fmt::Result { - struct Children<'a>(&'a [(Point, Element)]); - - impl Debug for Children<'_> { - fn fmt(&self, f: &mut Formatter) -> fmt::Result { - f.debug_map().entries(self.0.iter().map(|(k, v)| (k, v))).finish() - } - } - f.debug_struct("Frame") .field("size", &self.size) .field("baseline", &self.baseline) - .field("children", &Children(&self.elements)) + .field( + "children", + &crate::util::debug(|f| { + f.debug_map() + .entries(self.elements.iter().map(|(k, v)| (k, v))) + .finish() + }), + ) .finish() } } |
