diff options
author | extrawurst <mail@rusticorn.com> | 2022-09-02 09:17:34 +0200 |
---|---|---|
committer | extrawurst <mail@rusticorn.com> | 2022-09-02 09:17:34 +0200 |
commit | 5101b395569bad4cfe3175e92d266a63efab2289 (patch) | |
tree | 5ec12556b6d6e5d1fccb32f00955cab8e22c807d /src/ui | |
parent | 4249a278b626058ef6a512c7e8bc604b35513802 (diff) |
switch from lazy_static to once_cell
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/syntax_text.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/ui/syntax_text.rs b/src/ui/syntax_text.rs index 5c6271aa..ea02bdc1 100644 --- a/src/ui/syntax_text.rs +++ b/src/ui/syntax_text.rs @@ -2,7 +2,7 @@ use asyncgit::{ asyncjob::{AsyncJob, RunParams}, ProgressPercent, }; -use lazy_static::lazy_static; +use once_cell::sync::Lazy; use scopetime::scope_time; use std::{ ffi::OsStr, @@ -32,11 +32,9 @@ pub struct SyntaxText { path: PathBuf, } -lazy_static! { - static ref SYNTAX_SET: SyntaxSet = - SyntaxSet::load_defaults_nonewlines(); - static ref THEME_SET: ThemeSet = ThemeSet::load_defaults(); -} +static SYNTAX_SET: Lazy<SyntaxSet> = + Lazy::new(SyntaxSet::load_defaults_nonewlines); +static THEME_SET: Lazy<ThemeSet> = Lazy::new(ThemeSet::load_defaults); pub struct AsyncProgressBuffer { current: usize, |