Skip to content

Commit be1c287

Browse files
authored
Miscellaneous documentation improvements in term.rs. (#110)
1 parent 9203949 commit be1c287

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

src/term.rs

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ pub enum TermFamily {
6161
pub struct TermFeatures<'a>(&'a Term);
6262

6363
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`)
6565
#[inline]
6666
pub fn is_attended(&self) -> bool {
6767
is_a_terminal(self.0)
6868
}
6969

70-
/// Checks if colors are supported by this terminal.
70+
/// Check if colors are supported by this terminal.
7171
///
7272
/// This does not check if colors are enabled. Currently all terminals
7373
/// are considered to support colors
@@ -76,7 +76,7 @@ impl<'a> TermFeatures<'a> {
7676
is_a_color_terminal(self.0)
7777
}
7878

79-
/// Checks if this terminal is an msys terminal.
79+
/// Check if this terminal is an msys terminal.
8080
///
8181
/// This is sometimes useful to disable features that are known to not
8282
/// work on msys terminals or require special handling.
@@ -92,13 +92,13 @@ impl<'a> TermFeatures<'a> {
9292
}
9393
}
9494

95-
/// Checks if this terminal wants emojis.
95+
/// Check if this terminal wants emojis.
9696
#[inline]
9797
pub fn wants_emoji(&self) -> bool {
9898
self.is_attended() && wants_emoji()
9999
}
100100

101-
/// Returns the family of the terminal.
101+
/// Return the family of the terminal.
102102
#[inline]
103103
pub fn family(&self) -> TermFamily {
104104
if !self.is_attended() {
@@ -204,7 +204,7 @@ impl Term {
204204
})
205205
}
206206

207-
/// Returns the style for the term
207+
/// Return the style for this terminal
208208
#[inline]
209209
pub fn style(&self) -> Style {
210210
match self.inner.target {
@@ -215,7 +215,7 @@ impl Term {
215215
}
216216
}
217217

218-
/// Returns the target
218+
/// Return the target of this terminal
219219
#[inline]
220220
pub fn target(&self) -> TermTarget {
221221
self.inner.target.clone()
@@ -229,7 +229,7 @@ impl Term {
229229
}
230230
}
231231

232-
/// Writes a string to the terminal and adds a newline.
232+
/// Write a string to the terminal and add a newline.
233233
pub fn write_line(&self, s: &str) -> io::Result<()> {
234234
match self.inner.buffer {
235235
Some(ref mutex) => {
@@ -242,7 +242,7 @@ impl Term {
242242
}
243243
}
244244

245-
/// Read a single character from the terminal
245+
/// Read a single character from the terminal.
246246
///
247247
/// This does not echo the character and blocks until a single character
248248
/// is entered.
@@ -333,7 +333,7 @@ impl Term {
333333
Ok(chars.iter().collect::<String>())
334334
}
335335

336-
/// Read securely a line of input.
336+
/// Read a line of input securely.
337337
///
338338
/// This is similar to `read_line` but will not echo the output. This
339339
/// also switches the terminal into a different mode where not all
@@ -351,7 +351,7 @@ impl Term {
351351
}
352352
}
353353

354-
/// Flushes internal buffers.
354+
/// Flush internal buffers.
355355
///
356356
/// This forces the contents of the internal buffer to be written to
357357
/// the terminal. This is unnecessary for unbuffered terminals which
@@ -367,71 +367,71 @@ impl Term {
367367
Ok(())
368368
}
369369

370-
/// Checks if the terminal is indeed a terminal.
370+
/// Check if the terminal is indeed a terminal.
371371
#[inline]
372372
pub fn is_term(&self) -> bool {
373373
self.is_tty
374374
}
375375

376-
/// Checks for common terminal features.
376+
/// Check for common terminal features.
377377
#[inline]
378378
pub fn features(&self) -> TermFeatures<'_> {
379379
TermFeatures(self)
380380
}
381381

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.
383383
#[inline]
384384
pub fn size(&self) -> (u16, u16) {
385385
self.size_checked().unwrap_or((24, DEFAULT_WIDTH))
386386
}
387387

388-
/// Returns the terminal size in rows and columns.
388+
/// Return the terminal size in rows and columns.
389389
///
390-
/// If the size cannot be reliably determined None is returned.
390+
/// If the size cannot be reliably determined `None` is returned.
391391
#[inline]
392392
pub fn size_checked(&self) -> Option<(u16, u16)> {
393393
terminal_size(self)
394394
}
395395

396-
/// Moves the cursor to `x` and `y`
396+
/// Move the cursor to row `x` and column `y`.
397397
#[inline]
398398
pub fn move_cursor_to(&self, x: usize, y: usize) -> io::Result<()> {
399399
move_cursor_to(self, x, y)
400400
}
401401

402-
/// Moves the cursor up `n` lines
402+
/// Move the cursor up `n` lines
403403
#[inline]
404404
pub fn move_cursor_up(&self, n: usize) -> io::Result<()> {
405405
move_cursor_up(self, n)
406406
}
407407

408-
/// Moves the cursor down `n` lines
408+
/// Move the cursor down `n` lines
409409
#[inline]
410410
pub fn move_cursor_down(&self, n: usize) -> io::Result<()> {
411411
move_cursor_down(self, n)
412412
}
413413

414-
/// Moves the cursor left `n` lines
414+
/// Move the cursor `n` characters to the left
415415
#[inline]
416416
pub fn move_cursor_left(&self, n: usize) -> io::Result<()> {
417417
move_cursor_left(self, n)
418418
}
419419

420-
/// Moves the cursor down `n` lines
420+
/// Move the cursor `n` characters to the right
421421
#[inline]
422422
pub fn move_cursor_right(&self, n: usize) -> io::Result<()> {
423423
move_cursor_right(self, n)
424424
}
425425

426-
/// Clears the current line.
426+
/// Clear the current line.
427427
///
428-
/// The positions the cursor at the beginning of the line again.
428+
/// This positions the cursor at the beginning of the current line.
429429
#[inline]
430430
pub fn clear_line(&self) -> io::Result<()> {
431431
clear_line(self)
432432
}
433433

434-
/// Clear the last `n` lines.
434+
/// Clear the last `n` lines before the current line.
435435
///
436436
/// This positions the cursor at the beginning of the first line
437437
/// that was cleared.
@@ -445,19 +445,19 @@ impl Term {
445445
Ok(())
446446
}
447447

448-
/// Clears the entire screen.
448+
/// Clear the entire screen.
449449
#[inline]
450450
pub fn clear_screen(&self) -> io::Result<()> {
451451
clear_screen(self)
452452
}
453453

454-
/// Clears the entire screen.
454+
/// Clear the entire screen.
455455
#[inline]
456456
pub fn clear_to_end_of_screen(&self) -> io::Result<()> {
457457
clear_to_end_of_screen(self)
458458
}
459459

460-
/// Clears the last char in the the current line.
460+
/// Clear the last `n` chars of the current line.
461461
#[inline]
462462
pub fn clear_chars(&self, n: usize) -> io::Result<()> {
463463
clear_chars(self, n)
@@ -471,13 +471,13 @@ impl Term {
471471
set_title(title);
472472
}
473473

474-
/// Makes cursor visible again
474+
/// Make the cursor visible again
475475
#[inline]
476476
pub fn show_cursor(&self) -> io::Result<()> {
477477
show_cursor(self)
478478
}
479479

480-
/// Hides cursor
480+
/// Hide the cursor
481481
#[inline]
482482
pub fn hide_cursor(&self) -> io::Result<()> {
483483
hide_cursor(self)

0 commit comments

Comments
 (0)