diff options
Diffstat (limited to 'src/layout/stack.rs')
| -rw-r--r-- | src/layout/stack.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/layout/stack.rs b/src/layout/stack.rs index 4b148ad8..e3416e6b 100644 --- a/src/layout/stack.rs +++ b/src/layout/stack.rs @@ -1,3 +1,5 @@ +use std::fmt::{self, Debug, Formatter}; + use super::*; /// A node that stacks its children. @@ -14,7 +16,6 @@ pub struct StackNode { } /// A child of a stack node. -#[derive(Debug)] #[cfg_attr(feature = "layout-cache", derive(Hash))] pub enum StackChild { /// Spacing between other nodes. @@ -39,6 +40,15 @@ impl From<StackNode> for LayoutNode { } } +impl Debug for StackChild { + fn fmt(&self, f: &mut Formatter) -> fmt::Result { + match self { + Self::Spacing(v) => write!(f, "Spacing({:?})", v), + Self::Any(node, _) => node.fmt(f), + } + } +} + /// Performs stack layout. struct StackLayouter<'a> { /// The stack node to layout. |
