diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-09-10 15:09:56 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-09-10 15:10:35 +0200 |
| commit | 18190f377a556ae5d5bb855044a95ecea071432f (patch) | |
| tree | 00dc34d14d8daa0911dcf152a51cdf3e153aebde /src/layout/tree.rs | |
| parent | b0b4607725d55cc99c13986e14294e0da3e56e08 (diff) | |
Reimplement `Debug` for layout nodes
Diffstat (limited to 'src/layout/tree.rs')
| -rw-r--r-- | src/layout/tree.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/layout/tree.rs b/src/layout/tree.rs index 224313f6..28cbbb51 100644 --- a/src/layout/tree.rs +++ b/src/layout/tree.rs @@ -1,3 +1,5 @@ +use std::fmt::{self, Debug, Formatter}; + use super::*; use std::any::Any; @@ -9,6 +11,7 @@ use std::hash::{Hash, Hasher}; use fxhash::FxHasher64; /// A tree of layout nodes. +#[derive(Debug)] pub struct LayoutTree { /// Runs of pages with the same properties. pub runs: Vec<PageRun>, @@ -22,6 +25,7 @@ impl LayoutTree { } /// A run of pages that all have the same properties. +#[derive(Debug)] pub struct PageRun { /// The size of each page. pub size: Size, @@ -95,6 +99,12 @@ impl Layout for LayoutNode { } } +impl Debug for LayoutNode { + fn fmt(&self, f: &mut Formatter) -> fmt::Result { + self.node.fmt(f) + } +} + #[cfg(feature = "layout-cache")] impl Hash for LayoutNode { fn hash<H: Hasher>(&self, state: &mut H) { |
