diff options
| author | MaxVerevkin <maxxverrr@gmail.com> | 2023-04-17 12:37:22 +0300 |
|---|---|---|
| committer | MaxVerevkin <maxxverrr@gmail.com> | 2023-04-17 12:37:22 +0300 |
| commit | 08a5f2a976c4c71aad2011a01fff5782fd5e23e7 (patch) | |
| tree | 210df42d5439507d97a63bbb91ae771883eff05b /src | |
| parent | d3b488c95817c75ad6ac892e9826da8d9dd189b3 (diff) | |
| download | i3bar-mango-08a5f2a976c4c71aad2011a01fff5782fd5e23e7.tar.gz | |
remove unnecessary Lazy
Diffstat (limited to 'src')
| -rw-r--r-- | src/text.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/text.rs b/src/text.rs index 617a60e..dcad438 100644 --- a/src/text.rs +++ b/src/text.rs @@ -1,17 +1,16 @@ use crate::color::Color; -use once_cell::sync::Lazy; use pango::FontDescription; use pangocairo::{cairo, pango}; use serde::Deserialize; use std::f64::consts::{FRAC_PI_2, PI, TAU}; thread_local! { - pub static PANGO_CTX: Lazy<pango::Context> = Lazy::new(|| { + pub static PANGO_CTX: pango::Context = { let context = pango::Context::new(); let fontmap = pangocairo::FontMap::new(); context.set_font_map(Some(&fontmap)); context - }); + }; } #[derive(Clone, Debug, PartialEq)] @@ -63,8 +62,6 @@ impl ComputedText { let layout = PANGO_CTX.with(|ctx| pango::Layout::new(ctx)); layout.set_font_description(Some(attr.font)); - - layout.set_font_description(Some(attr.font)); if attr.markup { layout.set_markup(&text); } else { |
