summaryrefslogtreecommitdiffstats
path: root/src/kitty/mod.rs
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2021-06-02 13:45:12 +0200
committerCanop <cano.petrole@gmail.com>2021-06-02 13:45:12 +0200
commit77f40f74c38392a5213f99006138d74772ac5c6c (patch)
tree145732e2e45e0dd3bf17e2a2f3e07027cc5d3338 /src/kitty/mod.rs
parent7635373786d1c0fbc45c326d4a0a8914396f7051 (diff)
make the number of threads used for file summing configurable
Also replace lazy_static with once_cell
Diffstat (limited to 'src/kitty/mod.rs')
-rw-r--r--src/kitty/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/kitty/mod.rs b/src/kitty/mod.rs
index 07cb901..04f4ba7 100644
--- a/src/kitty/mod.rs
+++ b/src/kitty/mod.rs
@@ -3,13 +3,13 @@ mod image_renderer;
pub use image_renderer::*;
use {
- lazy_static::lazy_static,
+ once_cell::sync::Lazy,
std::sync::Mutex,
};
-lazy_static! {
- static ref RENDERER: Option<Mutex<KittyImageRenderer>> = KittyImageRenderer::new().map(Mutex::new);
-}
+static RENDERER: Lazy<Option<Mutex<KittyImageRenderer>>> = Lazy::new(|| {
+ KittyImageRenderer::new().map(Mutex::new)
+});
// TODO try to find another way (making app_context mut ?) to pass this
// around without the mutex gymnastic, and also to make it really lazy