Don't clone strings when looking up font family

This commit is contained in:
Dániel Buga 2022-09-05 22:43:18 +02:00
parent bf5a98a6d4
commit 19238425f2
1 changed files with 2 additions and 2 deletions

View File

@ -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())
}
}