From dbfb3d2ced91e56314dfabbb4df9a338926c0a7a Mon Sep 17 00:00:00 2001 From: Laurenz Date: Mon, 3 Aug 2020 16:01:23 +0200 Subject: =?UTF-8?q?Formatting,=20documentation=20and=20small=20improvement?= =?UTF-8?q?s=20=F0=9F=A7=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/library/layout.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/library/layout.rs') diff --git a/src/library/layout.rs b/src/library/layout.rs index d6d02436..f3ddaadf 100644 --- a/src/library/layout.rs +++ b/src/library/layout.rs @@ -1,5 +1,3 @@ -//! Layout building blocks. - use crate::length::ScaleLength; use super::*; @@ -13,7 +11,7 @@ function! { } parse(header, body, state, f) { - BoxFunc { + Self { body: parse_maybe_body(body, state, f).unwrap_or(SyntaxTree::new()), width: header.args.key.get::("width", f), height: header.args.key.get::("height", f), @@ -21,8 +19,8 @@ function! { } layout(self, ctx, f) { - ctx.repeat = false; ctx.spaces.truncate(1); + ctx.repeat = false; self.width.with(|v| { let length = v.raw_scaled(ctx.base.x); @@ -51,13 +49,13 @@ function! { #[derive(Debug, Clone, PartialEq)] pub struct AlignFunc { body: Option, - aligns: Vec>, + aligns: SpanVec, h: Option>, v: Option>, } parse(header, body, state, f) { - AlignFunc { + Self { body: parse_maybe_body(body, state, f), aligns: header.args.pos.all::>().collect(), h: header.args.key.get::>("horizontal", f), -- cgit v1.2.3