mirror of https://github.com/lapce/lapce.git
Don't clone strings when looking up font family
This commit is contained in:
parent
bf5a98a6d4
commit
19238425f2
|
@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue