allow specifying username with empty password

Reolink cameras ship with username "admin", password "", so this is
necessary to use them fresh out of the box.
This commit is contained in:
Scott Lamb 2021-08-20 09:45:58 -07:00
parent 826b81a95c
commit f904ba7a79

View File

@ -296,7 +296,11 @@ impl Opener for RetinaOpener {
let creds = match (username, password) {
(None, None) => None,
(Some(username), Some(password)) => Some(Credentials { username, password }),
_ => bail!("expected username and password together"),
(Some(username), None) => Some(Credentials {
username,
password: String::new(),
}),
_ => bail!("must supply username when supplying password"),
};
// TODO: connection timeout.