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/par.rs | |
| parent | fb0cd3df6e1e1077c6f19c319726c9aa9678325b (diff) | |
Simplify node construction
Diffstat (limited to 'src/layout/par.rs')
| -rw-r--r-- | src/layout/par.rs | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/layout/par.rs b/src/layout/par.rs index 64265b63..a645eb07 100644 --- a/src/layout/par.rs +++ b/src/layout/par.rs @@ -12,8 +12,7 @@ use crate::util::{EcoString, RangeExt, SliceExt}; type Range = std::ops::Range<usize>; /// A node that arranges its children into a paragraph. -#[derive(Debug)] -#[cfg_attr(feature = "layout-cache", derive(Hash))] +#[derive(Debug, Hash)] pub struct ParNode { /// The inline direction of this paragraph. pub dir: Dir, @@ -24,7 +23,7 @@ pub struct ParNode { } /// A child of a paragraph node. -#[cfg_attr(feature = "layout-cache", derive(Hash))] +#[derive(Hash)] pub enum ParChild { /// Spacing between other nodes. Spacing(Spacing), @@ -93,12 +92,6 @@ impl ParNode { } } -impl From<ParNode> for BlockNode { - fn from(node: ParNode) -> Self { - Self::new(node) - } -} - impl Debug for ParChild { fn fmt(&self, f: &mut Formatter) -> fmt::Result { match self { |
