diff options
Diffstat (limited to 'crates/typst-cli')
| -rw-r--r-- | crates/typst-cli/src/terminal.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/typst-cli/src/terminal.rs b/crates/typst-cli/src/terminal.rs index cf2906eb..45b8c82b 100644 --- a/crates/typst-cli/src/terminal.rs +++ b/crates/typst-cli/src/terminal.rs @@ -1,15 +1,16 @@ use std::io::{self, IsTerminal, Write}; use codespan_reporting::term::termcolor; -use once_cell::sync::Lazy; use termcolor::{ColorChoice, WriteColor}; +use typst::utils::singleton; use crate::ARGS; /// Returns a handle to the optionally colored terminal output. pub fn out() -> TermOut { - static OUTPUT: Lazy<TermOutInner> = Lazy::new(TermOutInner::new); - TermOut { inner: &OUTPUT } + TermOut { + inner: singleton!(TermOutInner, TermOutInner::new()), + } } /// The stuff that has to be shared between instances of [`TermOut`]. |
