Use ouroboros in FontSystem to avoid lifetime bound

Perhaps not quite what ouroboros is expected to be used for, but it's
not too bad, and avoiding the lifetime bound can be a huge help.
This commit is contained in:
Ian Douglas Scott 2022-11-02 19:25:18 -07:00 committed by Jeremy Soller
parent ac354c3a2a
commit 0d3fb1dd9d
8 changed files with 85 additions and 62 deletions

View file

@ -45,7 +45,7 @@ use self::text_box::text_box;
mod text_box;
lazy_static::lazy_static! {
static ref FONT_SYSTEM: FontSystem<'static> = FontSystem::new();
static ref FONT_SYSTEM: FontSystem = FontSystem::new();
}
static FONT_SIZES: &'static [Metrics] = &[
@ -137,9 +137,9 @@ impl Application for Window {
fn title(&self) -> String {
if let Some(path) = &self.path_opt {
format!("COSMIC Text - {} - {}", FONT_SYSTEM.locale, path.display())
format!("COSMIC Text - {} - {}", FONT_SYSTEM.locale(), path.display())
} else {
format!("COSMIC Text - {}", FONT_SYSTEM.locale)
format!("COSMIC Text - {}", FONT_SYSTEM.locale())
}
}