From e8bf36eb78247ca28db034ae34884bf71677c605 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Sat, 15 Jun 2024 12:17:41 +0700 Subject: [PATCH] Fix some typos --- README.md | 2 +- examples/cursor_at.rs | 4 ++-- src/lib.rs | 4 ++-- src/unix_term.rs | 2 +- src/windows_term/mod.rs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0a04eb07..3cf71524 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ term.clear_line()?; ## Colors and Styles -`console` automaticaly detects when to use colors based on the tty flag. It also +`console` automatically detects when to use colors based on the tty flag. It also provides higher level wrappers for styling text and other things that can be displayed with the `style` function and utility types. diff --git a/examples/cursor_at.rs b/examples/cursor_at.rs index 9a1bb3d5..52876fd2 100644 --- a/examples/cursor_at.rs +++ b/examples/cursor_at.rs @@ -8,9 +8,9 @@ use console::{style, Term}; fn write_chars() -> io::Result<()> { let term = Term::stdout(); - let (heigth, width) = term.size(); + let (height, width) = term.size(); for x in 0..width { - for y in 0..heigth { + for y in 0..height { term.move_cursor_to(x as usize, y as usize)?; let text = if (x + y) % 2 == 0 { format!("{}", style(x % 10).black().on_red()) diff --git a/src/lib.rs b/src/lib.rs index a1ac2275..365bda9f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -33,7 +33,7 @@ //! //! # Colors and Styles //! -//! `console` automaticaly detects when to use colors based on the tty flag. It also +//! `console` automatically detects when to use colors based on the tty flag. It also //! provides higher level wrappers for styling text and other things that can be //! displayed with the `style` function and utility types. //! @@ -56,7 +56,7 @@ //! //! # Working with ANSI Codes //! -//! The crate provids the function `strip_ansi_codes` to remove ANSI codes +//! The crate provides the function `strip_ansi_codes` to remove ANSI codes //! from a string as well as `measure_text_width` to calculate the width of a //! string as it would be displayed by the terminal. Both of those together //! are useful for more complex formatting. diff --git a/src/unix_term.rs b/src/unix_term.rs index 271709f2..ec04ac7e 100644 --- a/src/unix_term.rs +++ b/src/unix_term.rs @@ -317,7 +317,7 @@ pub fn read_single_key(ctrlc_key: bool) -> io::Result { let rv: io::Result = read_single_key_impl(fd); c_result(|| unsafe { libc::tcsetattr(fd, libc::TCSADRAIN, &original) })?; - // if the user hit ^C we want to signal SIGINT to outselves. + // if the user hit ^C we want to signal SIGINT to ourselves. if let Err(ref err) = rv { if err.kind() == io::ErrorKind::Interrupted { if !ctrlc_key { diff --git a/src/windows_term/mod.rs b/src/windows_term/mod.rs index 173f3ef5..1cfd7711 100644 --- a/src/windows_term/mod.rs +++ b/src/windows_term/mod.rs @@ -402,7 +402,7 @@ pub fn read_single_key(_ctrlc_key: bool) -> io::Result { // Confirm that there is a next character to read. if get_key_event_count()? == 0 { let message = format!( - "Read invlid utf16 {}: {}", + "Read invalid utf16 {}: {}", unicode_char, InvalidUtf16Tuple::MissingSecond );