diff --git a/src/renderer/fonts/caching_shaper.rs b/src/renderer/fonts/caching_shaper.rs index ebc47bd..ebc44c4 100644 --- a/src/renderer/fonts/caching_shaper.rs +++ b/src/renderer/fonts/caching_shaper.rs @@ -53,13 +53,15 @@ impl CachingShaper { bold: options.bold, font_selection: options.fallback_list.first().unwrap().clone().into(), }) - .unwrap_or(default_key.clone()); + .unwrap_or_else(|| default_key.clone()); if let Some(font_pair) = self.font_loader.get_or_load(&font_key) { return font_pair; - } + } - self.font_loader.get_or_load(&default_key).expect("Could not load font") + self.font_loader + .get_or_load(&default_key) + .expect("Could not load font") } pub fn current_size(&self) -> f32 { @@ -112,7 +114,12 @@ impl CachingShaper { (metrics.ascent + metrics.leading) as u64 } - fn build_clusters(&mut self, text: &str, bold: bool, italic: bool) -> Vec<(Vec, Arc)> { + fn build_clusters( + &mut self, + text: &str, + bold: bool, + italic: bool, + ) -> Vec<(Vec, Arc)> { let mut cluster = CharCluster::new(); // Enumerate the characters storing the glyph index in the user data so that we can position diff --git a/src/window/window_wrapper/mod.rs b/src/window/window_wrapper/mod.rs index 8006457..6ee1dd7 100644 --- a/src/window/window_wrapper/mod.rs +++ b/src/window/window_wrapper/mod.rs @@ -20,7 +20,6 @@ use glutin::{ ContextBuilder, GlProfile, WindowedContext, }; - #[cfg(target_os = "linux")] use glutin::platform::unix::WindowBuilderExtUnix;