fix a couple of simple clipy warnings (#32813)

Signed-off-by: Rodion Borovyk <rodion.borovyk@gmail.com>
This commit is contained in:
Rodion Borovyk 2024-07-19 15:18:34 +02:00 committed by GitHub
parent 5eb77592ea
commit 4bf5024ee0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 9 additions and 13 deletions

View file

@ -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

View file

@ -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;