Don't clone strings when looking up font family
@@ -307,7 +307,7 @@ pub fn font_family(&self) -> FontFamily {
if self.font_family.is_empty() {
FontFamily::SYSTEM_UI
} else {
- FontFamily::new_unchecked(self.font_family.clone())
+ FontFamily::new_unchecked(self.font_family.as_str())
}
}
@@ -345,7 +345,7 @@ pub fn hover_font_family(&self) -> FontFamily {
if self.hover_font_family.is_empty() {
self.font_family()
} else {
- FontFamily::new_unchecked(self.hover_font_family.clone())
+ FontFamily::new_unchecked(self.hover_font_family.as_str())
}
}
