summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-02-04 09:35:29 +0100
committerLaurenz <laurmaedje@gmail.com>2020-02-04 09:35:29 +0100
commitf655656fb8cb6135b26e7960ce0b7adf96d6f567 (patch)
tree218ace99f2c38aa51a5d503414046ca6c295ad91 /src/library
parentec60795575c29ee7fc2ea7507cfcc38958fe67bf (diff)
Streamline Key + Value traits 🌊
Diffstat (limited to 'src/library')
-rw-r--r--src/library/font.rs6
-rw-r--r--src/library/layout.rs6
-rw-r--r--src/library/page.rs2
3 files changed, 8 insertions, 6 deletions
diff --git a/src/library/font.rs b/src/library/font.rs
index 8e62563e..be4d263f 100644
--- a/src/library/font.rs
+++ b/src/library/font.rs
@@ -14,7 +14,9 @@ function! {
parse(header, body, ctx, errors, decos) {
FontFamilyFunc {
body: body!(opt: body, ctx, errors, decos),
- list: header.args.pos.get_all::<StringLike>(errors).collect(),
+ list: header.args.pos.get_all::<StringLike>(errors)
+ .map(Into::into)
+ .collect(),
}
}
@@ -58,7 +60,7 @@ function! {
parse(header, body, ctx, errors, decos) {
let body = body!(opt: body, ctx, errors, decos);
- let weight = header.args.pos.get::<Spanned<FontWeight>>(errors)
+ let weight = header.args.pos.get::<Spanned<(FontWeight, bool)>>(errors)
.map(|Spanned { v: (weight, is_clamped), span }| {
if is_clamped {
errors.push(err!(@Warning: span;
diff --git a/src/library/layout.rs b/src/library/layout.rs
index d36cd0e0..591ea2c0 100644
--- a/src/library/layout.rs
+++ b/src/library/layout.rs
@@ -13,7 +13,7 @@ function! {
parse(header, body, ctx, errors, decos) {
AlignFunc {
body: body!(opt: body, ctx, errors, decos),
- map: PosAxisMap::parse::<AxisKey, AlignmentValue>(errors, &mut header.args),
+ map: PosAxisMap::parse::<AxisKey>(errors, &mut header.args),
}
}
@@ -59,7 +59,7 @@ function! {
DirectionFunc {
name_span: header.name.span,
body: body!(opt: body, ctx, errors, decos),
- map: PosAxisMap::parse::<AxisKey, Direction>(errors, &mut header.args),
+ map: PosAxisMap::parse::<AxisKey>(errors, &mut header.args),
}
}
@@ -106,7 +106,7 @@ function! {
parse(header, body, ctx, errors, decos) {
BoxFunc {
body: body!(opt: body, ctx, errors, decos).unwrap_or(SyntaxModel::new()),
- extents: AxisMap::parse::<ExtentKey, PSize>(errors, &mut header.args.key),
+ extents: AxisMap::parse::<ExtentKey>(errors, &mut header.args.key),
debug: header.args.key.get::<bool>(errors, "debug"),
}
}
diff --git a/src/library/page.rs b/src/library/page.rs
index e2a4d687..084b3446 100644
--- a/src/library/page.rs
+++ b/src/library/page.rs
@@ -16,7 +16,7 @@ function! {
body!(nope: body, errors);
PageSizeFunc {
paper: header.args.pos.get::<Paper>(errors),
- extents: AxisMap::parse::<ExtentKey, Size>(errors, &mut header.args.key),
+ extents: AxisMap::parse::<ExtentKey>(errors, &mut header.args.key),
flip: header.args.key.get::<bool>(errors, "flip").unwrap_or(false),
}
}