|
1 | 1 | //! Defines the colors used in the output of the CLI. |
2 | 2 |
|
| 3 | +use std::sync::LazyLock; |
| 4 | + |
3 | 5 | use console::Style; |
4 | 6 | use log::Level; |
5 | | -use once_cell::sync::Lazy; |
6 | 7 |
|
7 | | -pub(crate) static NORMAL: Lazy<Style> = Lazy::new(Style::new); |
8 | | -pub(crate) static DIM: Lazy<Style> = Lazy::new(|| Style::new().dim()); |
| 8 | +pub(crate) static NORMAL: LazyLock<Style> = LazyLock::new(Style::new); |
| 9 | +pub(crate) static DIM: LazyLock<Style> = LazyLock::new(|| Style::new().dim()); |
9 | 10 |
|
10 | | -pub(crate) static GREEN: Lazy<Style> = Lazy::new(|| Style::new().color256(2).bold().bright()); |
11 | | -pub(crate) static BOLD_GREEN: Lazy<Style> = Lazy::new(|| Style::new().color256(82).bold().bright()); |
12 | | -pub(crate) static YELLOW: Lazy<Style> = Lazy::new(|| Style::new().yellow().bright()); |
13 | | -pub(crate) static BOLD_YELLOW: Lazy<Style> = Lazy::new(|| Style::new().yellow().bold().bright()); |
14 | | -pub(crate) static PINK: Lazy<Style> = Lazy::new(|| Style::new().color256(197)); |
15 | | -pub(crate) static BOLD_PINK: Lazy<Style> = Lazy::new(|| Style::new().color256(197).bold()); |
| 11 | +pub(crate) static GREEN: LazyLock<Style> = |
| 12 | + LazyLock::new(|| Style::new().color256(2).bold().bright()); |
| 13 | +pub(crate) static BOLD_GREEN: LazyLock<Style> = |
| 14 | + LazyLock::new(|| Style::new().color256(82).bold().bright()); |
| 15 | +pub(crate) static YELLOW: LazyLock<Style> = LazyLock::new(|| Style::new().yellow().bright()); |
| 16 | +pub(crate) static BOLD_YELLOW: LazyLock<Style> = |
| 17 | + LazyLock::new(|| Style::new().yellow().bold().bright()); |
| 18 | +pub(crate) static PINK: LazyLock<Style> = LazyLock::new(|| Style::new().color256(197)); |
| 19 | +pub(crate) static BOLD_PINK: LazyLock<Style> = LazyLock::new(|| Style::new().color256(197).bold()); |
16 | 20 |
|
17 | 21 | // Used for debug log messages |
18 | | -pub(crate) static BLUE: Lazy<Style> = Lazy::new(|| Style::new().blue().bright()); |
| 22 | +pub(crate) static BLUE: LazyLock<Style> = LazyLock::new(|| Style::new().blue().bright()); |
19 | 23 |
|
20 | 24 | // Write output using predefined colors |
21 | 25 | macro_rules! color { |
|
0 commit comments