Apply suggestions from code review

This commit is contained in:
Andrew King authored and GitHub committed 2021-09-08 16:29:03 +07:00
1 parent 79e012647a
commit a301944298
6 files changed
+51 -7

No files matched your search

+1 -1
View File
@@ -23,7 +23,7 @@ impl AddressOrUid {
pub(crate) fn new(address: &Option<String>, uid: &Option<String>) -> Result<Self, Error> {
match (address, uid) {
(None, None) => Err(anyhow!("Neither address or uid given")),
(Some(_), Some(_)) => Err(anyhow!("Either address of uid should be given not both")),
(Some(_), Some(_)) => Err(anyhow!("Either address or uid should be given not both")),
(Some(host), None) => Ok(AddressOrUid::Address(host.clone())),
(None, Some(host)) => Ok(AddressOrUid::Uid(host.clone())),
}