From 140f6830a9b404b6772151778f78504ba3ff07f8 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Thu, 2 Dec 2021 14:18:21 +0100 Subject: [PATCH] Rename CommandWithExtension to Command --- epp-client/src/request.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/epp-client/src/request.rs b/epp-client/src/request.rs index 447a64f..de737c3 100644 --- a/epp-client/src/request.rs +++ b/epp-client/src/request.rs @@ -25,7 +25,7 @@ pub trait EppRequest: Sized + Debug { fn serialize_request(self, client_tr_id: &str) -> Result> { let (command, extension) = self.into_parts(); let extension = extension.map(|data| Extension { data }); - EppXml::serialize(&EppObject::build(CommandWithExtension { + EppXml::serialize(&EppObject::build(Command { command, extension, client_tr_id: client_tr_id.into(), @@ -54,7 +54,7 @@ pub trait EppExtension: ElementName + DeserializeOwned + Serialize + Sized + Deb #[element_name(name = "command")] /// Type corresponding to the <command> tag in an EPP XML request /// with an <extension> tag -pub struct CommandWithExtension { +pub struct Command { /// The instance that will be used to populate the <command> tag pub command: T, /// The client TRID @@ -63,9 +63,7 @@ pub struct CommandWithExtension { pub client_tr_id: StringValue, } -impl Serialize - for CommandWithExtension -{ +impl Serialize for Command { /// Serializes the generic type T to the proper XML tag (set by the `#[element_name(name = )]` attribute) for the request fn serialize(&self, serializer: S) -> Result where @@ -79,10 +77,10 @@ impl Serialize } } -impl CommandWithExtension { +impl Command { /// Creates a new <command> tag for an EPP document with a containing <extension> tag - pub fn build(command: T, ext: E, client_tr_id: &str) -> CommandWithExtension { - CommandWithExtension { + pub fn build(command: T, ext: E, client_tr_id: &str) -> Command { + Command { command, extension: Some(Extension { data: ext }), client_tr_id: client_tr_id.into(),