@@ -61,13 +61,13 @@ pub enum TermFamily {
61
61
pub struct TermFeatures < ' a > ( & ' a Term ) ;
62
62
63
63
impl < ' a > TermFeatures < ' a > {
64
- /// Checks if this is a real user attended terminal (`isatty`)
64
+ /// Check if this is a real user attended terminal (`isatty`)
65
65
#[ inline]
66
66
pub fn is_attended ( & self ) -> bool {
67
67
is_a_terminal ( self . 0 )
68
68
}
69
69
70
- /// Checks if colors are supported by this terminal.
70
+ /// Check if colors are supported by this terminal.
71
71
///
72
72
/// This does not check if colors are enabled. Currently all terminals
73
73
/// are considered to support colors
@@ -76,7 +76,7 @@ impl<'a> TermFeatures<'a> {
76
76
is_a_color_terminal ( self . 0 )
77
77
}
78
78
79
- /// Checks if this terminal is an msys terminal.
79
+ /// Check if this terminal is an msys terminal.
80
80
///
81
81
/// This is sometimes useful to disable features that are known to not
82
82
/// work on msys terminals or require special handling.
@@ -92,13 +92,13 @@ impl<'a> TermFeatures<'a> {
92
92
}
93
93
}
94
94
95
- /// Checks if this terminal wants emojis.
95
+ /// Check if this terminal wants emojis.
96
96
#[ inline]
97
97
pub fn wants_emoji ( & self ) -> bool {
98
98
self . is_attended ( ) && wants_emoji ( )
99
99
}
100
100
101
- /// Returns the family of the terminal.
101
+ /// Return the family of the terminal.
102
102
#[ inline]
103
103
pub fn family ( & self ) -> TermFamily {
104
104
if !self . is_attended ( ) {
@@ -204,7 +204,7 @@ impl Term {
204
204
} )
205
205
}
206
206
207
- /// Returns the style for the term
207
+ /// Return the style for this terminal
208
208
#[ inline]
209
209
pub fn style ( & self ) -> Style {
210
210
match self . inner . target {
@@ -215,7 +215,7 @@ impl Term {
215
215
}
216
216
}
217
217
218
- /// Returns the target
218
+ /// Return the target of this terminal
219
219
#[ inline]
220
220
pub fn target ( & self ) -> TermTarget {
221
221
self . inner . target . clone ( )
@@ -229,7 +229,7 @@ impl Term {
229
229
}
230
230
}
231
231
232
- /// Writes a string to the terminal and adds a newline.
232
+ /// Write a string to the terminal and add a newline.
233
233
pub fn write_line ( & self , s : & str ) -> io:: Result < ( ) > {
234
234
match self . inner . buffer {
235
235
Some ( ref mutex) => {
@@ -242,7 +242,7 @@ impl Term {
242
242
}
243
243
}
244
244
245
- /// Read a single character from the terminal
245
+ /// Read a single character from the terminal.
246
246
///
247
247
/// This does not echo the character and blocks until a single character
248
248
/// is entered.
@@ -333,7 +333,7 @@ impl Term {
333
333
Ok ( chars. iter ( ) . collect :: < String > ( ) )
334
334
}
335
335
336
- /// Read securely a line of input.
336
+ /// Read a line of input securely .
337
337
///
338
338
/// This is similar to `read_line` but will not echo the output. This
339
339
/// also switches the terminal into a different mode where not all
@@ -351,7 +351,7 @@ impl Term {
351
351
}
352
352
}
353
353
354
- /// Flushes internal buffers.
354
+ /// Flush internal buffers.
355
355
///
356
356
/// This forces the contents of the internal buffer to be written to
357
357
/// the terminal. This is unnecessary for unbuffered terminals which
@@ -367,71 +367,71 @@ impl Term {
367
367
Ok ( ( ) )
368
368
}
369
369
370
- /// Checks if the terminal is indeed a terminal.
370
+ /// Check if the terminal is indeed a terminal.
371
371
#[ inline]
372
372
pub fn is_term ( & self ) -> bool {
373
373
self . is_tty
374
374
}
375
375
376
- /// Checks for common terminal features.
376
+ /// Check for common terminal features.
377
377
#[ inline]
378
378
pub fn features ( & self ) -> TermFeatures < ' _ > {
379
379
TermFeatures ( self )
380
380
}
381
381
382
- /// Returns the terminal size in rows and columns or gets sensible defaults.
382
+ /// Return the terminal size in rows and columns or gets sensible defaults.
383
383
#[ inline]
384
384
pub fn size ( & self ) -> ( u16 , u16 ) {
385
385
self . size_checked ( ) . unwrap_or ( ( 24 , DEFAULT_WIDTH ) )
386
386
}
387
387
388
- /// Returns the terminal size in rows and columns.
388
+ /// Return the terminal size in rows and columns.
389
389
///
390
- /// If the size cannot be reliably determined None is returned.
390
+ /// If the size cannot be reliably determined ` None` is returned.
391
391
#[ inline]
392
392
pub fn size_checked ( & self ) -> Option < ( u16 , u16 ) > {
393
393
terminal_size ( self )
394
394
}
395
395
396
- /// Moves the cursor to `x` and `y`
396
+ /// Move the cursor to row `x` and column `y`.
397
397
#[ inline]
398
398
pub fn move_cursor_to ( & self , x : usize , y : usize ) -> io:: Result < ( ) > {
399
399
move_cursor_to ( self , x, y)
400
400
}
401
401
402
- /// Moves the cursor up `n` lines
402
+ /// Move the cursor up `n` lines
403
403
#[ inline]
404
404
pub fn move_cursor_up ( & self , n : usize ) -> io:: Result < ( ) > {
405
405
move_cursor_up ( self , n)
406
406
}
407
407
408
- /// Moves the cursor down `n` lines
408
+ /// Move the cursor down `n` lines
409
409
#[ inline]
410
410
pub fn move_cursor_down ( & self , n : usize ) -> io:: Result < ( ) > {
411
411
move_cursor_down ( self , n)
412
412
}
413
413
414
- /// Moves the cursor left `n` lines
414
+ /// Move the cursor `n` characters to the left
415
415
#[ inline]
416
416
pub fn move_cursor_left ( & self , n : usize ) -> io:: Result < ( ) > {
417
417
move_cursor_left ( self , n)
418
418
}
419
419
420
- /// Moves the cursor down `n` lines
420
+ /// Move the cursor `n` characters to the right
421
421
#[ inline]
422
422
pub fn move_cursor_right ( & self , n : usize ) -> io:: Result < ( ) > {
423
423
move_cursor_right ( self , n)
424
424
}
425
425
426
- /// Clears the current line.
426
+ /// Clear the current line.
427
427
///
428
- /// The positions the cursor at the beginning of the line again .
428
+ /// This positions the cursor at the beginning of the current line .
429
429
#[ inline]
430
430
pub fn clear_line ( & self ) -> io:: Result < ( ) > {
431
431
clear_line ( self )
432
432
}
433
433
434
- /// Clear the last `n` lines.
434
+ /// Clear the last `n` lines before the current line .
435
435
///
436
436
/// This positions the cursor at the beginning of the first line
437
437
/// that was cleared.
@@ -445,19 +445,19 @@ impl Term {
445
445
Ok ( ( ) )
446
446
}
447
447
448
- /// Clears the entire screen.
448
+ /// Clear the entire screen.
449
449
#[ inline]
450
450
pub fn clear_screen ( & self ) -> io:: Result < ( ) > {
451
451
clear_screen ( self )
452
452
}
453
453
454
- /// Clears the entire screen.
454
+ /// Clear the entire screen.
455
455
#[ inline]
456
456
pub fn clear_to_end_of_screen ( & self ) -> io:: Result < ( ) > {
457
457
clear_to_end_of_screen ( self )
458
458
}
459
459
460
- /// Clears the last char in the the current line.
460
+ /// Clear the last `n` chars of the current line.
461
461
#[ inline]
462
462
pub fn clear_chars ( & self , n : usize ) -> io:: Result < ( ) > {
463
463
clear_chars ( self , n)
@@ -471,13 +471,13 @@ impl Term {
471
471
set_title ( title) ;
472
472
}
473
473
474
- /// Makes cursor visible again
474
+ /// Make the cursor visible again
475
475
#[ inline]
476
476
pub fn show_cursor ( & self ) -> io:: Result < ( ) > {
477
477
show_cursor ( self )
478
478
}
479
479
480
- /// Hides cursor
480
+ /// Hide the cursor
481
481
#[ inline]
482
482
pub fn hide_cursor ( & self ) -> io:: Result < ( ) > {
483
483
hide_cursor ( self )
0 commit comments