diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-10-26 17:11:08 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-10-26 17:14:11 +0200 |
| commit | 5c534fb42881b508175dd25129f62e604bdae403 (patch) | |
| tree | fab522708f55d3ee132cb7a0789de701b795d847 /src/layout/stack.rs | |
| parent | fb0cd3df6e1e1077c6f19c319726c9aa9678325b (diff) | |
Simplify node construction
Diffstat (limited to 'src/layout/stack.rs')
| -rw-r--r-- | src/layout/stack.rs | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/layout/stack.rs b/src/layout/stack.rs index dbd9ddb0..0fb3e3eb 100644 --- a/src/layout/stack.rs +++ b/src/layout/stack.rs @@ -3,8 +3,7 @@ use std::fmt::{self, Debug, Formatter}; use super::*; /// A node that stacks its children. -#[derive(Debug)] -#[cfg_attr(feature = "layout-cache", derive(Hash))] +#[derive(Debug, Hash)] pub struct StackNode { /// The stacking direction. pub dir: Dir, @@ -13,7 +12,7 @@ pub struct StackNode { } /// A child of a stack node. -#[cfg_attr(feature = "layout-cache", derive(Hash))] +#[derive(Hash)] pub enum StackChild { /// Spacing between other nodes. Spacing(Spacing), @@ -31,12 +30,6 @@ impl BlockLevel for StackNode { } } -impl From<StackNode> for BlockNode { - fn from(node: StackNode) -> Self { - Self::new(node) - } -} - impl Debug for StackChild { fn fmt(&self, f: &mut Formatter) -> fmt::Result { match self { |
