Skip to content

Commit

Permalink
fix(wincon): Restore MSRV
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Jan 13, 2025
1 parent 86dca69 commit 1f3fef0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/anstyle-wincon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ lexopt = "0.3.0"

[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.59.0", features = ["Win32_System_Console", "Win32_Foundation"] }
once_cell = "1.20.2"

[lints]
workspace = true
6 changes: 4 additions & 2 deletions crates/anstyle-wincon/src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ type StdioColorInnerResult = Result<(anstyle::AnsiColor, anstyle::AnsiColor), in

/// Cached [`get_colors`] call for [`std::io::stdout`]
pub fn stdout_initial_colors() -> StdioColorResult {
static INITIAL: std::sync::OnceLock<StdioColorInnerResult> = std::sync::OnceLock::new();
static INITIAL: once_cell::sync::OnceCell<StdioColorInnerResult> =
once_cell::sync::OnceCell::new();
(*INITIAL.get_or_init(|| get_colors_(&std::io::stdout()))).map_err(Into::into)
}

/// Cached [`get_colors`] call for [`std::io::stderr`]
pub fn stderr_initial_colors() -> StdioColorResult {
static INITIAL: std::sync::OnceLock<StdioColorInnerResult> = std::sync::OnceLock::new();
static INITIAL: once_cell::sync::OnceCell<StdioColorInnerResult> =
once_cell::sync::OnceCell::new();
(*INITIAL.get_or_init(|| get_colors_(&std::io::stderr()))).map_err(Into::into)
}

Expand Down

0 comments on commit 1f3fef0

Please sign in to comment.