File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ term.clear_line()?;
3838
3939## Colors and Styles
4040
41- ` console ` automaticaly detects when to use colors based on the tty flag. It also
41+ ` console ` automatically detects when to use colors based on the tty flag. It also
4242provides higher level wrappers for styling text and other things that can be
4343displayed with the ` style ` function and utility types.
4444
Original file line number Diff line number Diff line change @@ -8,9 +8,9 @@ use console::{style, Term};
88
99fn write_chars ( ) -> io:: Result < ( ) > {
1010 let term = Term :: stdout ( ) ;
11- let ( heigth , width) = term. size ( ) ;
11+ let ( height , width) = term. size ( ) ;
1212 for x in 0 ..width {
13- for y in 0 ..heigth {
13+ for y in 0 ..height {
1414 term. move_cursor_to ( x as usize , y as usize ) ?;
1515 let text = if ( x + y) % 2 == 0 {
1616 format ! ( "{}" , style( x % 10 ) . black( ) . on_red( ) )
Original file line number Diff line number Diff line change 3333//!
3434//! # Colors and Styles
3535//!
36- //! `console` automaticaly detects when to use colors based on the tty flag. It also
36+ //! `console` automatically detects when to use colors based on the tty flag. It also
3737//! provides higher level wrappers for styling text and other things that can be
3838//! displayed with the `style` function and utility types.
3939//!
5656//!
5757//! # Working with ANSI Codes
5858//!
59- //! The crate provids the function `strip_ansi_codes` to remove ANSI codes
59+ //! The crate provides the function `strip_ansi_codes` to remove ANSI codes
6060//! from a string as well as `measure_text_width` to calculate the width of a
6161//! string as it would be displayed by the terminal. Both of those together
6262//! are useful for more complex formatting.
Original file line number Diff line number Diff line change @@ -323,7 +323,7 @@ pub fn read_single_key(ctrlc_key: bool) -> io::Result<Key> {
323323 let rv: io:: Result < Key > = read_single_key_impl ( fd) ;
324324 c_result ( || unsafe { libc:: tcsetattr ( fd, libc:: TCSADRAIN , & original) } ) ?;
325325
326- // if the user hit ^C we want to signal SIGINT to outselves .
326+ // if the user hit ^C we want to signal SIGINT to ourselves .
327327 if let Err ( ref err) = rv {
328328 if err. kind ( ) == io:: ErrorKind :: Interrupted {
329329 if !ctrlc_key {
Original file line number Diff line number Diff line change @@ -402,7 +402,7 @@ pub fn read_single_key(_ctrlc_key: bool) -> io::Result<Key> {
402402 // Confirm that there is a next character to read.
403403 if get_key_event_count ( ) ? == 0 {
404404 let message = format ! (
405- "Read invlid utf16 {}: {}" ,
405+ "Read invalid utf16 {}: {}" ,
406406 unicode_char,
407407 Utf16TupleError :: MissingSecond
408408 ) ;
You can’t perform that action at this time.
0 commit comments