From 6a8a0ec6ec8bb8cf346ee0dd2c45ddcfbee7fbe6 Mon Sep 17 00:00:00 2001 From: Martin Haug Date: Tue, 3 May 2022 11:40:27 +0200 Subject: Code Review: Heap is Stack. Unsafe is Good. Spaghetti Code is Style. --- tests/ref/layout/page.png | Bin 7390 -> 7401 bytes tests/typ/graphics/shape-rect.typ | 8 ++++---- tests/typ/layout/page-margin.typ | 8 ++++---- tests/typeset.rs | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'tests') diff --git a/tests/ref/layout/page.png b/tests/ref/layout/page.png index e0618e58..35716e4d 100644 Binary files a/tests/ref/layout/page.png and b/tests/ref/layout/page.png differ diff --git a/tests/typ/graphics/shape-rect.typ b/tests/typ/graphics/shape-rect.typ index 3d157675..a29550b5 100644 --- a/tests/typ/graphics/shape-rect.typ +++ b/tests/typ/graphics/shape-rect.typ @@ -35,20 +35,20 @@ // Different strokes. [ - #set rect(stroke: (right: red,)) + #set rect(stroke: (right: red)) #rect(width: 100%, fill: lime, stroke: (x: 5pt, y: 1pt)) ] --- // Outset padding. -#let inline-code(body) = [ +#show node: raw as [ #set text("IBM Plex Mono", 8pt) #h(.7em, weak: true) - #rect(radius: 3pt, outset: (y: 3pt, x: 2.5pt), fill: rgb(239, 241, 243), body) + #rect(radius: 3pt, outset: (y: 3pt, x: 2.5pt), fill: rgb(239, 241, 243))[{node.text}] #h(.7em, weak: true) ] -Use the #inline-code[\*const ptr] pointer. +Use the `*const ptr` pointer. --- // Error: 15-38 unexpected key "cake" diff --git a/tests/typ/layout/page-margin.typ b/tests/typ/layout/page-margin.typ index e30518b0..290c4081 100644 --- a/tests/typ/layout/page-margin.typ +++ b/tests/typ/layout/page-margin.typ @@ -11,10 +11,10 @@ --- // Set individual margins. #set page(height: 40pt) -[#set page(margins: (left: 0pt,)); #align(left)[Left]] -[#set page(margins: (right: 0pt,)); #align(right)[Right]] -[#set page(margins: (top: 0pt,)); #align(top)[Top]] -[#set page(margins: (bottom: 0pt,)); #align(bottom)[Bottom]] +[#set page(margins: (left: 0pt)); #align(left)[Left]] +[#set page(margins: (right: 0pt)); #align(right)[Right]] +[#set page(margins: (top: 0pt)); #align(top)[Top]] +[#set page(margins: (bottom: 0pt)); #align(bottom)[Bottom]] // Ensure that specific margins override general margins. [#set page(margins: (rest: 0pt, left: 20pt)); Overriden] diff --git a/tests/typeset.rs b/tests/typeset.rs index d3f7844b..b0452163 100644 --- a/tests/typeset.rs +++ b/tests/typeset.rs @@ -66,7 +66,7 @@ fn main() { styles.set(PageNode::HEIGHT, Smart::Auto); styles.set( PageNode::MARGINS, - Sides::splat(Smart::Custom(Length::pt(10.0).into())), + Sides::splat(Some(Smart::Custom(Length::pt(10.0).into()))), ); styles.set(TextNode::SIZE, TextSize(Length::pt(10.0).into())); -- cgit v1.2.3