summaryrefslogtreecommitdiff
path: root/src/layout/incremental.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/layout/incremental.rs')
-rw-r--r--src/layout/incremental.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/layout/incremental.rs b/src/layout/incremental.rs
index 32353d6f..baf2991a 100644
--- a/src/layout/incremental.rs
+++ b/src/layout/incremental.rs
@@ -1,5 +1,5 @@
#[cfg(feature = "layout-cache")]
-use std::collections::{hash_map::Entry, HashMap};
+use std::collections::HashMap;
use std::ops::Deref;
use super::*;
@@ -68,13 +68,10 @@ impl LayoutCache {
frames: Vec<Constrained<Rc<Frame>>>,
level: usize,
) {
- let entry = FramesEntry::new(frames, level);
- match self.frames.entry(hash) {
- Entry::Occupied(occupied) => occupied.into_mut().push(entry),
- Entry::Vacant(vacant) => {
- vacant.insert(vec![entry]);
- }
- }
+ self.frames
+ .entry(hash)
+ .or_default()
+ .push(FramesEntry::new(frames, level));
}
/// Clear the cache.