Closed qt2 closed 1 year ago
Are you still working on this? I check the test it's failing
Are you still working on this? I check the test it's failing
Sorry for the late reply. The test failure was due to an incorrectly configured import in doc-test. I will fix it and commit it later. Thank you for pointing this out.
@pksunkara
In order for interact_on
to function without mut, the validator needs Fn
instead of FnMut
, so a new PasswordValidator
trait was added separately from the Validator
for Input. Also replaced &String
with &str
where possible.
You don't need a password validator trait and the String -> str. I won't be merging them. Please keep it similar to Input
except for the mut
part.
@pksunkara
Hmm, I have no idea using V::Err
in validate_with
method. Simply adopting your change suggestion raised an error "associated type Err
not found for V
". Could you tell me some workaround on it, if possible?
If using E
instead of V::Err
is fine, then I'll revert the last commit.
I was mistaken, Input
has a trait already. So, this trait is okay with me.
The only change I would request is to keep the original &String
and not &str
. The validate function should be dealing in &T
where T
is the output of the prompt, which is String
in the password prompt.
Hey @pksunkara, how's the release process for this?
Done.
Closes #150
Implement validation function in
Password
which would be useful for checking the strength of passwords. This PR includes:validator
property andvalidate_with
method toPassword
interact_on
method