From 1d78ca5cb3c7ce7c091b62edf06d788070894c1a 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 9e958111..3350badb 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,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 bf5978f7..f22250a7 100644 --- a/src/unix_term.rs +++ b/src/unix_term.rs @@ -323,7 +323,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 acf2882b..bad957c8 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, Utf16TupleError::MissingSecond );