summaryrefslogtreecommitdiff
path: root/src/library/layout.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-10-26 17:11:08 +0200
committerLaurenz <laurmaedje@gmail.com>2021-10-26 17:14:11 +0200
commit5c534fb42881b508175dd25129f62e604bdae403 (patch)
treefab522708f55d3ee132cb7a0789de701b795d847 /src/library/layout.rs
parentfb0cd3df6e1e1077c6f19c319726c9aa9678325b (diff)
Simplify node construction
Diffstat (limited to 'src/library/layout.rs')
-rw-r--r--src/library/layout.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/library/layout.rs b/src/library/layout.rs
index 4ef0926f..f7fb2882 100644
--- a/src/library/layout.rs
+++ b/src/library/layout.rs
@@ -154,7 +154,7 @@ pub fn boxed(_: &mut EvalContext, args: &mut Args) -> TypResult<Value> {
width,
height,
fill: fill.map(Paint::Color),
- child: Some(body.to_stack(style).into()),
+ child: Some(body.to_stack(style).pack()),
}
})))
}
@@ -186,7 +186,7 @@ pub fn pad(_: &mut EvalContext, args: &mut Args) -> TypResult<Value> {
Ok(Value::Template(Template::from_block(move |style| {
PadNode {
padding,
- child: body.to_stack(&style).into(),
+ child: body.to_stack(&style).pack(),
}
})))
}
@@ -227,7 +227,7 @@ pub fn stack(_: &mut EvalContext, args: &mut Args) -> TypResult<Value> {
children.push(StackChild::Spacing(v));
}
- let node = template.to_stack(style).into();
+ let node = template.to_stack(style).pack();
children.push(StackChild::Node(node, style.aligns.block));
delayed = spacing;
}
@@ -283,7 +283,7 @@ pub fn grid(_: &mut EvalContext, args: &mut Args) -> TypResult<Value> {
gutter: gutter.clone(),
children: children
.iter()
- .map(|child| child.to_stack(&style).into())
+ .map(|child| child.to_stack(&style).pack())
.collect(),
}
})))