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