We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df37b03 commit 0f53723Copy full SHA for 0f53723
src/prompts/password.rs
@@ -8,6 +8,8 @@ use crate::{
8
use console::Term;
9
use zeroize::Zeroizing;
10
11
+type PasswordValidatorCallback<'a> = Box<dyn FnMut(&String) -> Option<String> + 'a>;
12
+
13
/// Renders a password input prompt.
14
///
15
/// ## Example usage
@@ -28,7 +30,7 @@ pub struct Password<'a> {
28
30
theme: &'a dyn Theme,
29
31
allow_empty_password: bool,
32
confirmation_prompt: Option<(String, String)>,
- validator: Option<Box<dyn FnMut(&String) -> Option<String> + 'a>>,
33
+ validator: Option<PasswordValidatorCallback<'a>>,
34
}
35
36
impl Default for Password<'static> {
0 commit comments