From 80a9b300d1acb8821ac0600aad3d2135ad9587bd Mon Sep 17 00:00:00 2001 From: Martin Date: Fri, 18 Jun 2021 13:01:55 +0200 Subject: Ref count the frames --- src/layout/incremental.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/layout/incremental.rs') diff --git a/src/layout/incremental.rs b/src/layout/incremental.rs index 7857f33c..a5c3cea3 100644 --- a/src/layout/incremental.rs +++ b/src/layout/incremental.rs @@ -26,7 +26,7 @@ impl LayoutCache { where F: FnMut(usize) -> bool, { - self.frames.retain(|_, b| f(b.level)); + self.frames.retain(|_, entry| f(entry.level)); } /// Amount of items in the cache. @@ -39,14 +39,14 @@ impl LayoutCache { /// Cached frames from past layouting. pub struct FramesEntry { /// The cached frames for a node. - pub frames: Vec>, + pub frames: Vec>>, /// How nested the frame was in the context is was originally appearing in. pub level: usize, } impl FramesEntry { /// Checks if the cached [`Frame`] is valid for the given regions. - pub fn check(&self, mut regions: Regions) -> Option>> { + pub fn check(&self, mut regions: Regions) -> Option>>> { for (i, frame) in self.frames.iter().enumerate() { if (i != 0 && !regions.next()) || !frame.constraints.check(®ions) { return None; -- cgit v1.2.3