From 4615d63b132c4522b90bcaf80aa137ac2f1bf51c Mon Sep 17 00:00:00 2001 From: Nicholas Rempel Date: Tue, 18 Jan 2022 16:12:06 -0800 Subject: [PATCH] Make it possible to create hosts without addresses --- src/host/create.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/host/create.rs b/src/host/create.rs index ff07f37..f609d69 100644 --- a/src/host/create.rs +++ b/src/host/create.rs @@ -13,12 +13,12 @@ impl<'a> Command for HostCreate<'a> { } impl<'a> HostCreate<'a> { - pub fn new(host: &'a str, addresses: &'a [HostAddr]) -> Self { + pub fn new(host: &'a str, addresses: Option<&'a [HostAddr]>) -> Self { Self { host: HostCreateRequestData { xmlns: XMLNS, name: host.into(), - addresses: Some(addresses), + addresses, }, } } @@ -84,7 +84,7 @@ mod tests { HostAddr::new("v6", "2404:6800:4001:801::200e"), ]; - let object = HostCreate::new("host1.eppdev-1.com", addresses); + let object = HostCreate::new("host1.eppdev-1.com", Some(addresses)); let serialized = >::serialize_request(&object, None, CLTRID)