From 5c534fb42881b508175dd25129f62e604bdae403 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Tue, 26 Oct 2021 17:11:08 +0200 Subject: Simplify node construction --- src/layout/stack.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src/layout/stack.rs') 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 for BlockNode { - fn from(node: StackNode) -> Self { - Self::new(node) - } -} - impl Debug for StackChild { fn fmt(&self, f: &mut Formatter) -> fmt::Result { match self { -- cgit v1.2.3