From bbcdeb128cce04cd95714b7bc7af5a23a7e38bd2 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 29 Jul 2020 18:09:51 +0200 Subject: =?UTF-8?q?Move,=20rename=20and=20switch=20some=20things=20(boring?= =?UTF-8?q?)=20=F0=9F=9A=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Problems -> Diagnostics - Position -> Pos - offset_spans -> Offset trait - Size -> Length (and some more size types renamed) - Paper into its own module - scope::Parser -> parsing::CallParser - Create `Decorations` alias - Remove lots of double newlines - Switch from f32 to f64 --- src/library/spacing.rs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/library/spacing.rs') diff --git a/src/library/spacing.rs b/src/library/spacing.rs index adca20af..5ae25a92 100644 --- a/src/library/spacing.rs +++ b/src/library/spacing.rs @@ -1,10 +1,9 @@ -use crate::size::FSize; +use crate::length::ScaleLength; use crate::layout::SpacingKind; use super::*; use self::ContentKind::*; - function! { /// `line.break`, `n`: Ends the current line. #[derive(Debug, Default, Clone, PartialEq)] @@ -41,7 +40,7 @@ function! { pub struct ContentSpacingFunc { body: Option, content: ContentKind, - spacing: Option, + spacing: Option, } type Meta = ContentKind; @@ -50,9 +49,9 @@ function! { ContentSpacingFunc { body: body!(opt: body, state, f), content: meta, - spacing: header.args.pos.get::(&mut f.problems) - .map(|num| num as f32) - .or_missing(&mut f.problems, header.name.span, "spacing"), + spacing: header.args.pos.get::(&mut f.diagnostics) + .map(|num| num as f64) + .or_missing(&mut f.diagnostics, header.name.span, "spacing"), } } @@ -79,7 +78,7 @@ function! { /// `spacing`, `h`, `v`: Adds spacing along an axis. #[derive(Debug, Clone, PartialEq)] pub struct SpacingFunc { - spacing: Option<(AxisKey, FSize)>, + spacing: Option<(AxisKey, ScaleLength)>, } type Meta = Option; @@ -88,11 +87,11 @@ function! { body!(nope: body, f); SpacingFunc { spacing: if let Some(axis) = meta { - header.args.pos.get::(&mut f.problems) + header.args.pos.get::(&mut f.diagnostics) .map(|s| (AxisKey::Specific(axis), s)) } else { - header.args.key.get_with_key::(&mut f.problems) - }.or_missing(&mut f.problems, header.name.span, "spacing"), + header.args.key.get_with_key::(&mut f.diagnostics) + }.or_missing(&mut f.diagnostics, header.name.span, "spacing"), } } -- cgit v1.2.3