@@ -4,7 +4,7 @@ use crate::theme::{SimpleTheme, TermThemeRenderer, Theme};
4
4
5
5
use console:: { Key , Term } ;
6
6
7
- /// Renders a confirm prompt.
7
+ /// Render a confirmation prompt.
8
8
///
9
9
/// ## Example usage
10
10
///
@@ -35,20 +35,20 @@ impl Default for Confirm<'static> {
35
35
}
36
36
37
37
impl Confirm < ' static > {
38
- /// Creates a confirm prompt.
38
+ /// Create a confirmation prompt.
39
39
pub fn new ( ) -> Self {
40
40
Self :: with_theme ( & SimpleTheme )
41
41
}
42
42
}
43
43
44
44
impl Confirm < ' _ > {
45
- /// Sets the confirm prompt.
45
+ /// Set the confirmation prompt message .
46
46
pub fn with_prompt < S : Into < String > > ( & mut self , prompt : S ) -> & mut Self {
47
47
self . prompt = prompt. into ( ) ;
48
48
self
49
49
}
50
50
51
- /// Indicates whether or not to report the chosen selection after interaction.
51
+ /// Indicate whether or not to report the chosen selection after interaction.
52
52
///
53
53
/// The default is to report the chosen selection.
54
54
pub fn report ( & mut self , val : bool ) -> & mut Self {
@@ -76,7 +76,7 @@ impl Confirm<'_> {
76
76
self
77
77
}
78
78
79
- /// Sets a default.
79
+ /// Set a default choice for the prompt .
80
80
///
81
81
/// Out of the box the prompt does not have a default and will continue
82
82
/// to display until the user inputs something and hits enter. If a default is set the user
@@ -86,15 +86,15 @@ impl Confirm<'_> {
86
86
self
87
87
}
88
88
89
- /// Disables or enables the default value display.
89
+ /// Disable or enable the default value display.
90
90
///
91
91
/// The default is to append the default value to the prompt to tell the user.
92
92
pub fn show_default ( & mut self , val : bool ) -> & mut Self {
93
93
self . show_default = val;
94
94
self
95
95
}
96
96
97
- /// Enables user interaction and returns the result.
97
+ /// Enable user interaction and return the result.
98
98
///
99
99
/// The dialog is rendered on stderr.
100
100
///
@@ -105,7 +105,7 @@ impl Confirm<'_> {
105
105
self . interact_on ( & Term :: stderr ( ) )
106
106
}
107
107
108
- /// Enables user interaction and returns the result.
108
+ /// Enable user interaction and return the result.
109
109
///
110
110
/// The dialog is rendered on stderr.
111
111
///
@@ -116,7 +116,7 @@ impl Confirm<'_> {
116
116
self . interact_on_opt ( & Term :: stderr ( ) )
117
117
}
118
118
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.
120
120
///
121
121
/// ## Examples
122
122
///
@@ -178,7 +178,7 @@ impl Confirm<'_> {
178
178
let rv;
179
179
180
180
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
182
182
// before validation.
183
183
let mut value = default_if_show;
184
184
@@ -215,8 +215,8 @@ impl Confirm<'_> {
215
215
render. confirm_prompt ( & self . prompt , value) ?;
216
216
}
217
217
} 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.
220
220
loop {
221
221
let input = term. read_key ( ) ?;
222
222
let value = match input {
@@ -246,7 +246,7 @@ impl Confirm<'_> {
246
246
}
247
247
248
248
impl < ' a > Confirm < ' a > {
249
- /// Creates a confirm prompt with a specific theme.
249
+ /// Create a confirm prompt with a specific theme.
250
250
///
251
251
/// ## Examples
252
252
/// ```rust,no_run
0 commit comments