Gain the function read_password_with_reader() which accepts an Option<T> where T: BufRead
Retain the function read_password() as a compatibility shim which calls the new function with None
Gain a test for the new functionality.
The purpose of these changes are to allow for library authors to have the option to directly call the new function with a Cursor or similar to easily mock out STDIN and prevent tests hanging waiting for input.
If this PR is merged rpassword will:
read_password_with_reader()
which accepts anOption<T> where T: BufRead
read_password()
as a compatibility shim which calls the new function withNone
The purpose of these changes are to allow for library authors to have the option to directly call the new function with a
Cursor
or similar to easily mock outSTDIN
and prevent tests hanging waiting for input.