diff options
Diffstat (limited to 'alacritty/src/renderer')
-rw-r--r-- | alacritty/src/renderer/mod.rs | 7 | ||||
-rw-r--r-- | alacritty/src/renderer/rects.rs | 3 | ||||
-rw-r--r-- | alacritty/src/renderer/text/glyph_cache.rs | 7 |
3 files changed, 9 insertions, 8 deletions
diff --git a/alacritty/src/renderer/mod.rs b/alacritty/src/renderer/mod.rs index fc586dc9..98e29542 100644 --- a/alacritty/src/renderer/mod.rs +++ b/alacritty/src/renderer/mod.rs @@ -3,6 +3,7 @@ use std::ffi::{CStr, CString}; use std::sync::atomic::{AtomicBool, Ordering}; use std::{fmt, ptr}; +use ahash::RandomState; use crossfont::Metrics; use glutin::context::{ContextApi, GlContext, PossiblyCurrentContext}; use glutin::display::{GetGlDisplay, GlDisplay}; @@ -290,13 +291,13 @@ impl GlExtensions { /// /// This function will lazyly load OpenGL extensions. fn contains(extension: &str) -> bool { - static OPENGL_EXTENSIONS: OnceCell<HashSet<&'static str>> = OnceCell::new(); + static OPENGL_EXTENSIONS: OnceCell<HashSet<&'static str, RandomState>> = OnceCell::new(); OPENGL_EXTENSIONS.get_or_init(Self::load_extensions).contains(extension) } /// Load available OpenGL extensions. - fn load_extensions() -> HashSet<&'static str> { + fn load_extensions() -> HashSet<&'static str, RandomState> { unsafe { let extensions = gl::GetString(gl::EXTENSIONS); @@ -313,7 +314,7 @@ impl GlExtensions { } else { match CStr::from_ptr(extensions as *mut _).to_str() { Ok(ext) => ext.split_whitespace().collect(), - Err(_) => HashSet::new(), + Err(_) => Default::default(), } } } diff --git a/alacritty/src/renderer/rects.rs b/alacritty/src/renderer/rects.rs index 8f6204c2..8d7a78e6 100644 --- a/alacritty/src/renderer/rects.rs +++ b/alacritty/src/renderer/rects.rs @@ -1,6 +1,7 @@ use std::collections::HashMap; use std::mem; +use ahash::RandomState; use crossfont::Metrics; use alacritty_terminal::grid::Dimensions; @@ -157,7 +158,7 @@ impl RenderLine { /// Lines for underline and strikeout. #[derive(Default)] pub struct RenderLines { - inner: HashMap<Flags, Vec<RenderLine>>, + inner: HashMap<Flags, Vec<RenderLine>, RandomState>, } impl RenderLines { diff --git a/alacritty/src/renderer/text/glyph_cache.rs b/alacritty/src/renderer/text/glyph_cache.rs index 72415900..a750e4e7 100644 --- a/alacritty/src/renderer/text/glyph_cache.rs +++ b/alacritty/src/renderer/text/glyph_cache.rs @@ -1,11 +1,10 @@ use std::collections::HashMap; -use std::hash::BuildHasherDefault; +use ahash::RandomState; use crossfont::{ Error as RasterizerError, FontDesc, FontKey, GlyphKey, Metrics, Rasterize, RasterizedGlyph, Rasterizer, Size, Slant, Style, Weight, }; -use fnv::FnvHasher; use log::{error, info}; use unicode_width::UnicodeWidthChar; @@ -46,7 +45,7 @@ pub struct Glyph { /// representations of the same code point. pub struct GlyphCache { /// Cache of buffered glyphs. - cache: HashMap<GlyphKey, Glyph, BuildHasherDefault<FnvHasher>>, + cache: HashMap<GlyphKey, Glyph, RandomState>, /// Rasterizer for loading new glyphs. rasterizer: Rasterizer, @@ -91,7 +90,7 @@ impl GlyphCache { let metrics = rasterizer.metrics(regular, font.size())?; Ok(Self { - cache: HashMap::default(), + cache: Default::default(), rasterizer, font_size: font.size(), font_key: regular, |