From e628d53980fb9fd4e6e3ef39baacdf8238ad9d9f Mon Sep 17 00:00:00 2001 From: Josh McKinney Date: Mon, 26 Aug 2024 13:05:32 -0700 Subject: [PATCH] docs: cleanup warnings --- src/cursor/sys/unix.rs | 2 +- src/lib.rs | 11 ++++------- src/style.rs | 2 +- src/style/types/colored.rs | 2 +- src/terminal.rs | 2 +- src/terminal/sys/unix.rs | 2 +- 6 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/cursor/sys/unix.rs b/src/cursor/sys/unix.rs index 473421207..1220e2e9d 100644 --- a/src/cursor/sys/unix.rs +++ b/src/cursor/sys/unix.rs @@ -13,7 +13,7 @@ use crate::{ /// The top left cell is represented as `(0, 0)`. /// /// On unix systems, this function will block and possibly time out while -/// [`crossterm::event::read`](crate::event::read) or [`crossterm::event::poll`](crate::event::poll) are being called. +/// [`crossterm::event::read`](crate::event::read()) or [`crossterm::event::poll`](crate::event::poll) are being called. pub fn position() -> io::Result<(u16, u16)> { if is_raw_mode_enabled() { read_position_raw() diff --git a/src/lib.rs b/src/lib.rs index 0217bef1c..e99ba4dcf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -251,10 +251,7 @@ mod command; pub(crate) mod macros; #[cfg(all(windows, not(feature = "windows")))] -compile_error!("Compiling on Windows with \"windows\" feature disabled. Feature \"windows\" should only be disabled when project will never be compiled on Windows."); - -#[cfg(all(winapi, not(feature = "winapi")))] -compile_error!("Compiling on Windows with \"winapi\" feature disabled. Feature \"winapi\" should only be disabled when project will never be compiled on Windows."); - -#[cfg(all(crossterm_winapi, not(feature = "crossterm_winapi")))] -compile_error!("Compiling on Windows with \"crossterm_winapi\" feature disabled. Feature \"crossterm_winapi\" should only be disabled when project will never be compiled on Windows."); +compile_error!( + "Compiling on Windows with \"windows\" feature disabled. \ +Feature \"windows\" should only be disabled when project will never be compiled on Windows." +); diff --git a/src/style.rs b/src/style.rs index b67a421b1..034b54ad6 100644 --- a/src/style.rs +++ b/src/style.rs @@ -184,7 +184,7 @@ pub fn available_color_count() -> u16 { /// /// # Notes /// -/// crossterm supports NO_COLOR (https://no-color.org/) to disabled colored output. +/// crossterm supports NO_COLOR () to disabled colored output. /// /// This API allows applications to override that behavior and force colorized output /// even if NO_COLOR is set. diff --git a/src/style/types/colored.rs b/src/style/types/colored.rs index c9feecdb7..47f356668 100644 --- a/src/style/types/colored.rs +++ b/src/style/types/colored.rs @@ -71,7 +71,7 @@ impl Colored { } /// Checks whether ansi color sequences are disabled by setting of NO_COLOR - /// in environment as per https://no-color.org/ + /// in environment as per pub fn ansi_color_disabled() -> bool { !std::env::var("NO_COLOR") .unwrap_or("".to_string()) diff --git a/src/terminal.rs b/src/terminal.rs index e7406bedd..3aebc1f8e 100644 --- a/src/terminal.rs +++ b/src/terminal.rs @@ -148,7 +148,7 @@ pub struct WindowSize { /// Returns the terminal size `[WindowSize]`. /// /// The width and height in pixels may not be reliably implemented or default to 0. -/// For unix, https://man7.org/linux/man-pages/man4/tty_ioctl.4.html documents them as "unused". +/// For unix, documents them as "unused". /// For windows it is not implemented. pub fn window_size() -> io::Result { sys::window_size() diff --git a/src/terminal/sys/unix.rs b/src/terminal/sys/unix.rs index 7129730a6..500be91fa 100644 --- a/src/terminal/sys/unix.rs +++ b/src/terminal/sys/unix.rs @@ -181,7 +181,7 @@ fn set_terminal_attr(fd: impl AsFd, termios: &Termios) -> io::Result<()> { /// Queries the terminal's support for progressive keyboard enhancement. /// /// On unix systems, this function will block and possibly time out while -/// [`crossterm::event::read`](crate::event::read) or [`crossterm::event::poll`](crate::event::poll) are being called. +/// [`event::read`](crate::event::read()) or [`event::poll`](crate::event::poll) are being called. #[cfg(feature = "events")] pub fn supports_keyboard_enhancement() -> io::Result { if is_raw_mode_enabled() {