summaryrefslogtreecommitdiff
path: root/src/library/document.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-12-05 12:54:03 +0100
committerLaurenz <laurmaedje@gmail.com>2021-12-05 12:54:03 +0100
commit26bdc1f0f6fe8113d7fcfb4d5aca46aa5238ccd8 (patch)
tree4c12a187032501735d858648a64fe66603f106a6 /src/library/document.rs
parent738ff7e1f573bef678932b313be9969a17af8d22 (diff)
Set Rules Episode I: The Phantom Style
Diffstat (limited to 'src/library/document.rs')
-rw-r--r--src/library/document.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/library/document.rs b/src/library/document.rs
index fe01d2df..b9a00f9b 100644
--- a/src/library/document.rs
+++ b/src/library/document.rs
@@ -3,14 +3,11 @@ use super::PageNode;
/// The root layout node, a document consisting of top-level page runs.
#[derive(Debug, Hash)]
-pub struct DocumentNode {
- /// The page runs.
- pub pages: Vec<PageNode>,
-}
+pub struct DocumentNode(pub Vec<PageNode>);
impl DocumentNode {
/// Layout the document into a sequence of frames, one per page.
pub fn layout(&self, ctx: &mut LayoutContext) -> Vec<Rc<Frame>> {
- self.pages.iter().flat_map(|node| node.layout(ctx)).collect()
+ self.0.iter().flat_map(|node| node.layout(ctx)).collect()
}
}