aboutsummaryrefslogtreecommitdiffstats
path: root/components/fonts
diff options
context:
space:
mode:
Diffstat (limited to 'components/fonts')
-rw-r--r--components/fonts/platform/macos/core_text_font_cache.rs4
-rw-r--r--components/fonts/shaper.rs4
2 files changed, 2 insertions, 6 deletions
diff --git a/components/fonts/platform/macos/core_text_font_cache.rs b/components/fonts/platform/macos/core_text_font_cache.rs
index bd59550d45e..6f41a25ce70 100644
--- a/components/fonts/platform/macos/core_text_font_cache.rs
+++ b/components/fonts/platform/macos/core_text_font_cache.rs
@@ -53,9 +53,7 @@ impl CoreTextFontCache {
}
let mut cache = cache.write();
- let identifier_cache = cache
- .entry(font_identifier.clone())
- .or_insert_with(Default::default);
+ let identifier_cache = cache.entry(font_identifier.clone()).or_default();
// It could be that between the time of the cache miss above and now, after the write lock
// on the cache has been acquired, the cache was populated with the data that we need. Thus
diff --git a/components/fonts/shaper.rs b/components/fonts/shaper.rs
index f5dbb5b0c74..addd44d8b26 100644
--- a/components/fonts/shaper.rs
+++ b/components/fonts/shaper.rs
@@ -612,9 +612,7 @@ impl Shaper {
}
pub unsafe fn get_baseline(&self) -> Option<FontBaseline> {
- if (*self.font).table_for_tag(BASE).is_none() {
- return None;
- }
+ (*self.font).table_for_tag(BASE)?;
let mut hanging_baseline = 0;
let mut alphabetic_baseline = 0;