From 470f8001a1dba0022ec9d3e46c67c3bbc31359be Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 30 Jun 2021 11:40:27 +0200 Subject: No more collisions between syntax::Tree and layout::Tree --- src/layout/mod.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/layout') diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 7ba556a1..e8bdab62 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -37,7 +37,11 @@ use crate::geom::*; use crate::loading::Loader; /// Layout a tree into a collection of frames. -pub fn layout(loader: &mut dyn Loader, cache: &mut Cache, tree: &Tree) -> Vec> { +pub fn layout( + loader: &mut dyn Loader, + cache: &mut Cache, + tree: &LayoutTree, +) -> Vec> { tree.layout(&mut LayoutContext { loader, cache, @@ -48,12 +52,12 @@ pub fn layout(loader: &mut dyn Loader, cache: &mut Cache, tree: &Tree) -> Vec, } -impl Tree { +impl LayoutTree { /// Layout the tree into a collection of frames. pub fn layout(&self, ctx: &mut LayoutContext) -> Vec> { self.runs.iter().flat_map(|run| run.layout(ctx)).collect() -- cgit v1.2.3