Skip to content

Commit 684a08a

Browse files
committed
doc: use imperative tense more in confirm.rs.
1 parent 0d28b43 commit 684a08a

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/prompts/confirm.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::theme::{SimpleTheme, TermThemeRenderer, Theme};
44

55
use console::{Key, Term};
66

7-
/// Renders a confirm prompt.
7+
/// Render a confirmation prompt.
88
///
99
/// ## Example usage
1010
///
@@ -35,20 +35,20 @@ impl Default for Confirm<'static> {
3535
}
3636

3737
impl Confirm<'static> {
38-
/// Creates a confirm prompt.
38+
/// Create a confirmation prompt.
3939
pub fn new() -> Self {
4040
Self::with_theme(&SimpleTheme)
4141
}
4242
}
4343

4444
impl Confirm<'_> {
45-
/// Sets the confirm prompt.
45+
/// Set the confirmation prompt message.
4646
pub fn with_prompt<S: Into<String>>(&mut self, prompt: S) -> &mut Self {
4747
self.prompt = prompt.into();
4848
self
4949
}
5050

51-
/// Indicates whether or not to report the chosen selection after interaction.
51+
/// Indicate whether or not to report the chosen selection after interaction.
5252
///
5353
/// The default is to report the chosen selection.
5454
pub fn report(&mut self, val: bool) -> &mut Self {
@@ -76,7 +76,7 @@ impl Confirm<'_> {
7676
self
7777
}
7878

79-
/// Sets a default.
79+
/// Set a default choice for the prompt.
8080
///
8181
/// Out of the box the prompt does not have a default and will continue
8282
/// to display until the user inputs something and hits enter. If a default is set the user
@@ -86,15 +86,15 @@ impl Confirm<'_> {
8686
self
8787
}
8888

89-
/// Disables or enables the default value display.
89+
/// Disable or enable the default value display.
9090
///
9191
/// The default is to append the default value to the prompt to tell the user.
9292
pub fn show_default(&mut self, val: bool) -> &mut Self {
9393
self.show_default = val;
9494
self
9595
}
9696

97-
/// Enables user interaction and returns the result.
97+
/// Enable user interaction and return the result.
9898
///
9999
/// The dialog is rendered on stderr.
100100
///
@@ -105,7 +105,7 @@ impl Confirm<'_> {
105105
self.interact_on(&Term::stderr())
106106
}
107107

108-
/// Enables user interaction and returns the result.
108+
/// Enable user interaction and return the result.
109109
///
110110
/// The dialog is rendered on stderr.
111111
///
@@ -116,7 +116,7 @@ impl Confirm<'_> {
116116
self.interact_on_opt(&Term::stderr())
117117
}
118118

119-
/// Like [interact](#method.interact) but allows a specific terminal to be set.
119+
/// Like [interact](#method.interact) but allow a specific terminal to be set.
120120
///
121121
/// ## Examples
122122
///
@@ -178,7 +178,7 @@ impl Confirm<'_> {
178178
let rv;
179179

180180
if self.wait_for_newline {
181-
// Waits for user input and for the user to hit the Enter key
181+
// Wait for user input and for the user to hit the Enter key
182182
// before validation.
183183
let mut value = default_if_show;
184184

@@ -215,8 +215,8 @@ impl Confirm<'_> {
215215
render.confirm_prompt(&self.prompt, value)?;
216216
}
217217
} else {
218-
// Default behavior: matches continuously on every keystroke,
219-
// and does not wait for user to hit the Enter key.
218+
// Default behavior: match continuously on every keystroke,
219+
// and do not wait for the user to hit the Enter key.
220220
loop {
221221
let input = term.read_key()?;
222222
let value = match input {
@@ -246,7 +246,7 @@ impl Confirm<'_> {
246246
}
247247

248248
impl<'a> Confirm<'a> {
249-
/// Creates a confirm prompt with a specific theme.
249+
/// Create a confirm prompt with a specific theme.
250250
///
251251
/// ## Examples
252252
/// ```rust,no_run

0 commit comments

Comments
 (0)