Skip to content

Commit

Permalink
docs(query): Document windows module
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Dec 8, 2023
1 parent feeec1f commit 0c7208f
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions crates/anstyle-query/src/windows.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Windows-specific style queries

#[cfg(windows)]
mod windows_console {
use std::os::windows::io::AsRawHandle;
Expand Down Expand Up @@ -45,17 +47,22 @@ mod windows_console {
}

#[inline]
pub fn enable_ansi_colors() -> Option<bool> {
pub(crate) fn enable_ansi_colors() -> Option<bool> {
Some(enable_ansi_colors_raw().map(|_| true).unwrap_or(false))
}
}

#[cfg(not(windows))]
mod windows_console {
#[inline]
pub fn enable_ansi_colors() -> Option<bool> {
pub(crate) fn enable_ansi_colors() -> Option<bool> {
None
}
}

pub use self::windows_console::enable_ansi_colors;
/// Enable ANSI escape codes (ENABLE_VIRTUAL_TERMINAL_PROCESSING)
///
/// For non-windows systems, returns `None`
pub fn enable_ansi_colors() -> Option<bool> {
windows_console::enable_ansi_colors()
}

0 comments on commit 0c7208f

Please sign in to comment.