From 537fe10beefe8ee0d0c1312f9a0ac4fc0f07ee9e Mon Sep 17 00:00:00 2001 From: Ritesh Chitlangi Date: Tue, 21 Dec 2021 00:05:12 +0800 Subject: [PATCH] minor fixes --- src/extensions/consolidate.rs | 14 +++++++------- src/extensions/namestore.rs | 10 ++++++++++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/extensions/consolidate.rs b/src/extensions/consolidate.rs index d98961d..7737903 100644 --- a/src/extensions/consolidate.rs +++ b/src/extensions/consolidate.rs @@ -19,10 +19,10 @@ impl Extension for Update { type Response = NoExtension; } -impl Transaction for DomainUpdate {} +impl Transaction> for DomainUpdate<'_> {} -impl Extension for UpdateWithNameStore { - type Response = NameStore; +impl<'a> Extension for UpdateWithNameStore<'a> { + type Response = NameStore<'a>; } #[derive(PartialEq, Debug)] @@ -78,12 +78,12 @@ impl Update { } } -impl UpdateWithNameStore { +impl UpdateWithNameStore<'_> { /// Create a new sync update with namestore request pub fn new(expiration: GMonthDay, subproduct: &str) -> Self { Self { sync: Update::new(expiration).data, - namestore: NameStore::new(subproduct).data, + namestore: NameStoreData::new(subproduct), } } } @@ -95,11 +95,11 @@ pub struct Update { } #[derive(Debug, Serialize)] -pub struct UpdateWithNameStore { +pub struct UpdateWithNameStore<'a> { #[serde(rename = "sync:update")] pub sync: UpdateData, #[serde(rename = "namestoreExt:namestoreExt")] - pub namestore: NameStoreData, + pub namestore: NameStoreData<'a>, } #[derive(Serialize, Debug)] diff --git a/src/extensions/namestore.rs b/src/extensions/namestore.rs index 96b54e6..dd19816 100644 --- a/src/extensions/namestore.rs +++ b/src/extensions/namestore.rs @@ -61,6 +61,16 @@ impl<'a> NameStore<'a> { } } +impl<'a> NameStoreData<'a> { + /// Create a new RGP restore report request + pub fn new(subproduct: &str) -> Self { + Self { + xmlns: XMLNS.into(), + subproduct: subproduct.to_owned().into(), + } + } +} + impl<'a> Extension for NameStore<'a> { type Response = NameStore<'static>; }