Skip to content

Commit 0f53723

Browse files
committed
Resolve clippy warning on complex type
1 parent df37b03 commit 0f53723

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/prompts/password.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ use crate::{
88
use console::Term;
99
use zeroize::Zeroizing;
1010

11+
type PasswordValidatorCallback<'a> = Box<dyn FnMut(&String) -> Option<String> + 'a>;
12+
1113
/// Renders a password input prompt.
1214
///
1315
/// ## Example usage
@@ -28,7 +30,7 @@ pub struct Password<'a> {
2830
theme: &'a dyn Theme,
2931
allow_empty_password: bool,
3032
confirmation_prompt: Option<(String, String)>,
31-
validator: Option<Box<dyn FnMut(&String) -> Option<String> + 'a>>,
33+
validator: Option<PasswordValidatorCallback<'a>>,
3234
}
3335

3436
impl Default for Password<'static> {

0 commit comments

Comments
 (0)