diff options
Diffstat (limited to 'src/render/markdown.rs')
| -rw-r--r-- | src/render/markdown.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/render/markdown.rs b/src/render/markdown.rs index f5f532d..33cdf47 100644 --- a/src/render/markdown.rs +++ b/src/render/markdown.rs @@ -3,6 +3,7 @@ use anyhow::{anyhow, Context, Result}; use crossterm::style::{Color, Stylize}; use crossterm::terminal; use std::collections::HashMap; +use std::sync::LazyLock; use syntect::highlighting::{Color as SyntectColor, FontStyle, Style, Theme}; use syntect::parsing::SyntaxSet; use syntect::{easy::HighlightLines, parsing::SyntaxReference}; @@ -10,14 +11,12 @@ use syntect::{easy::HighlightLines, parsing::SyntaxReference}; /// Comes from <https://github.com/sharkdp/bat/raw/5e77ca37e89c873e4490b42ff556370dc5c6ba4f/assets/syntaxes.bin> const SYNTAXES: &[u8] = include_bytes!("../../assets/syntaxes.bin"); -lazy_static::lazy_static! { - static ref LANG_MAPS: HashMap<String, String> = { - let mut m = HashMap::new(); - m.insert("csharp".into(), "C#".into()); - m.insert("php".into(), "PHP Source".into()); - m - }; -} +static LANG_MAPS: LazyLock<HashMap<String, String>> = LazyLock::new(|| { + let mut m = HashMap::new(); + m.insert("csharp".into(), "C#".into()); + m.insert("php".into(), "PHP Source".into()); + m +}); pub struct MarkdownRender { options: RenderOptions, |
