summaryrefslogtreecommitdiff
path: root/src/layout
diff options
context:
space:
mode:
Diffstat (limited to 'src/layout')
-rw-r--r--src/layout/incremental.rs2
-rw-r--r--src/layout/par.rs2
-rw-r--r--src/layout/shaping.rs5
3 files changed, 4 insertions, 5 deletions
diff --git a/src/layout/incremental.rs b/src/layout/incremental.rs
index 1dd90f8e..d41fe431 100644
--- a/src/layout/incremental.rs
+++ b/src/layout/incremental.rs
@@ -21,7 +21,7 @@ pub struct LayoutCache {
impl LayoutCache {
/// Create a new, empty layout cache.
pub fn new() -> Self {
- Self { frames: HashMap::new(), age: 0 }
+ Self::default()
}
/// Clear the cache.
diff --git a/src/layout/par.rs b/src/layout/par.rs
index 464853e0..34016737 100644
--- a/src/layout/par.rs
+++ b/src/layout/par.rs
@@ -285,7 +285,7 @@ fn split_runs<'a>(
range: Range,
) -> impl Iterator<Item = (Range, Dir)> + 'a {
let mut cursor = range.start;
- bidi.levels[range.clone()]
+ bidi.levels[range]
.group_by_key(|&level| level)
.map(move |(level, group)| {
let start = cursor;
diff --git a/src/layout/shaping.rs b/src/layout/shaping.rs
index 021e9ecc..2496aae0 100644
--- a/src/layout/shaping.rs
+++ b/src/layout/shaping.rs
@@ -235,9 +235,8 @@ fn shape_segment<'a>(
}
}
- match ctx.cache.font.select(ctx.loader, family, variant) {
- Some(id) => break (id, true),
- None => {}
+ if let Some(id) = ctx.cache.font.select(ctx.loader, family, variant) {
+ break (id, true);
}
}
// We're out of families, so we don't do any more fallback and just