diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-09-20 19:49:47 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-09-20 19:49:47 +0200 |
| commit | 3760748fddd3b793c79c370398a9d4a3fc5afc04 (patch) | |
| tree | b1a615e510aa231cfe9757a9c0a35a375e32e3ba /src/model/layout.rs | |
| parent | 757a701c1aa2a6fb80033c7e75666661818da6f9 (diff) | |
Refactor error handling
Diffstat (limited to 'src/model/layout.rs')
| -rw-r--r-- | src/model/layout.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/model/layout.rs b/src/model/layout.rs index 911cb4d5..68847471 100644 --- a/src/model/layout.rs +++ b/src/model/layout.rs @@ -6,7 +6,7 @@ use std::hash::Hash; use std::sync::Arc; use super::{Barrier, NodeId, Resolve, StyleChain, StyleEntry}; -use crate::diag::TypResult; +use crate::diag::SourceResult; use crate::eval::{RawAlign, RawLength}; use crate::frame::{Element, Frame}; use crate::geom::{ @@ -27,7 +27,7 @@ pub trait Layout: 'static { world: &dyn World, regions: &Regions, styles: StyleChain, - ) -> TypResult<Vec<Frame>>; + ) -> SourceResult<Vec<Frame>>; /// Convert to a packed node. fn pack(self) -> LayoutNode @@ -219,7 +219,7 @@ impl Layout for LayoutNode { world: &dyn World, regions: &Regions, styles: StyleChain, - ) -> TypResult<Vec<Frame>> { + ) -> SourceResult<Vec<Frame>> { let barrier = StyleEntry::Barrier(Barrier::new(self.id())); let styles = barrier.chain(&styles); @@ -288,7 +288,7 @@ impl Layout for EmptyNode { _: &dyn World, regions: &Regions, _: StyleChain, - ) -> TypResult<Vec<Frame>> { + ) -> SourceResult<Vec<Frame>> { Ok(vec![Frame::new( regions.expand.select(regions.first, Size::zero()), )]) @@ -310,7 +310,7 @@ impl Layout for SizedNode { world: &dyn World, regions: &Regions, styles: StyleChain, - ) -> TypResult<Vec<Frame>> { + ) -> SourceResult<Vec<Frame>> { // The "pod" is the region into which the child will be layouted. let pod = { // Resolve the sizing to a concrete size. @@ -357,7 +357,7 @@ impl Layout for FillNode { world: &dyn World, regions: &Regions, styles: StyleChain, - ) -> TypResult<Vec<Frame>> { + ) -> SourceResult<Vec<Frame>> { let mut frames = self.child.layout(world, regions, styles)?; for frame in &mut frames { let shape = Geometry::Rect(frame.size()).filled(self.fill); @@ -382,7 +382,7 @@ impl Layout for StrokeNode { world: &dyn World, regions: &Regions, styles: StyleChain, - ) -> TypResult<Vec<Frame>> { + ) -> SourceResult<Vec<Frame>> { let mut frames = self.child.layout(world, regions, styles)?; for frame in &mut frames { let shape = Geometry::Rect(frame.size()).stroked(self.stroke); |
