Use Cow for NameServers::ns

This commit is contained in:
Dirkjan Ochtman 2023-02-27 17:01:34 +01:00
parent da87740b3f
commit 3565e8eb07
2 changed files with 2 additions and 2 deletions

View File

@ -58,7 +58,7 @@ impl<'a> DomainCreate<'a> {
domain: DomainCreateRequestData {
name,
period,
ns: ns.map(|ns| NameServers { ns: ns.to_vec() }),
ns: ns.map(|ns| NameServers { ns: ns.into() }),
registrant,
auth_info: DomainAuthInfo::new(auth_password),
contacts,

View File

@ -130,7 +130,7 @@ pub enum HostInfo<'a> {
#[derive(Debug, FromXml, ToXml)]
#[xml(rename = "ns", ns(XMLNS))]
pub struct NameServers<'a> {
pub ns: Vec<HostInfo<'a>>,
pub ns: Cow<'a, [HostInfo<'a>]>,
}
/// The &lt;contact&gt; type on domain creation and update requests