Skip to content

Commit 4652d43

Browse files
committed
doc: Use imperative mode for doc comments in term.rs.
This is consistent with e.g. PEP-257. Before, the doc comments were inconsistent on this matter.
1 parent d150a69 commit 4652d43

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

src/term.rs

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

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

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

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

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

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

206-
/// Returns the style for the term
206+
/// Return the style for the term
207207
#[inline]
208208
pub fn style(&self) -> Style {
209209
match self.inner.target {
@@ -214,7 +214,7 @@ impl Term {
214214
}
215215
}
216216

217-
/// Returns the target
217+
/// Return the target
218218
#[inline]
219219
pub fn target(&self) -> TermTarget {
220220
self.inner.target.clone()
@@ -228,7 +228,7 @@ impl Term {
228228
}
229229
}
230230

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

244-
/// Read a single character from the terminal
244+
/// Read a single character from the terminal.
245245
///
246246
/// This does not echo the character and blocks until a single character
247247
/// is entered.
@@ -350,7 +350,7 @@ impl Term {
350350
}
351351
}
352352

353-
/// Flushes internal buffers.
353+
/// Flush internal buffers.
354354
///
355355
/// This forces the contents of the internal buffer to be written to
356356
/// the terminal. This is unnecessary for unbuffered terminals which
@@ -366,63 +366,63 @@ impl Term {
366366
Ok(())
367367
}
368368

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

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

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

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

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

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

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

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

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

425-
/// Clears the current line.
425+
/// Clear the current line.
426426
///
427427
/// The positions the cursor at the beginning of the line again.
428428
#[inline]
@@ -444,19 +444,19 @@ impl Term {
444444
Ok(())
445445
}
446446

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

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

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

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

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

0 commit comments

Comments
 (0)