@@ -5,7 +5,7 @@ use crate::theme::{SimpleTheme, TermThemeRenderer, Theme};
5
5
use console:: Term ;
6
6
use zeroize:: Zeroizing ;
7
7
8
- /// Renders a password input prompt.
8
+ /// Render a password input prompt.
9
9
///
10
10
/// ## Example usage
11
11
///
@@ -34,20 +34,20 @@ impl Default for Password<'static> {
34
34
}
35
35
36
36
impl Password < ' static > {
37
- /// Creates a password input prompt.
37
+ /// Create a password input prompt.
38
38
pub fn new ( ) -> Password < ' static > {
39
39
Self :: with_theme ( & SimpleTheme )
40
40
}
41
41
}
42
42
43
43
impl Password < ' _ > {
44
- /// Sets the password input prompt.
44
+ /// Set the password input prompt.
45
45
pub fn with_prompt < S : Into < String > > ( & mut self , prompt : S ) -> & mut Self {
46
46
self . prompt = prompt. into ( ) ;
47
47
self
48
48
}
49
49
50
- /// Indicates whether to report confirmation after interaction.
50
+ /// Indicate whether to report confirmation after interaction.
51
51
///
52
52
/// The default is to report.
53
53
pub fn report ( & mut self , val : bool ) -> & mut Self {
@@ -73,15 +73,15 @@ impl Password<'_> {
73
73
self
74
74
}
75
75
76
- /// Enables user interaction and returns the result.
76
+ /// Enable user interaction and return the result.
77
77
///
78
78
/// If the user confirms the result is `true`, `false` otherwise.
79
79
/// The dialog is rendered on stderr.
80
80
pub fn interact ( & self ) -> io:: Result < String > {
81
81
self . interact_on ( & Term :: stderr ( ) )
82
82
}
83
83
84
- /// Like `interact` but allows a specific terminal to be set.
84
+ /// Like [ `interact`](#method::interact), but allow a specific terminal to be set.
85
85
pub fn interact_on ( & self , term : & Term ) -> io:: Result < String > {
86
86
let mut render = TermThemeRenderer :: new ( term, self . theme ) ;
87
87
render. set_prompts_reset_height ( false ) ;
@@ -131,7 +131,7 @@ impl Password<'_> {
131
131
}
132
132
133
133
impl < ' a > Password < ' a > {
134
- /// Creates a password input prompt with a specific theme.
134
+ /// Create a password input prompt with a specific theme.
135
135
pub fn with_theme ( theme : & ' a dyn Theme ) -> Self {
136
136
Self {
137
137
prompt : "" . into ( ) ,
0 commit comments