From cf446f58c7de81640de4f42907a45af50be73153 Mon Sep 17 00:00:00 2001 From: Nicholas Rempel Date: Fri, 3 Dec 2021 10:07:36 -0800 Subject: [PATCH] Update Login::new to take ownership of Option ext_uris --- README.md | 2 +- epp-client/README.md | 2 +- epp-client/src/contact/check.rs | 2 +- epp-client/src/contact/create.rs | 2 +- epp-client/src/contact/delete.rs | 2 +- epp-client/src/contact/info.rs | 2 +- epp-client/src/contact/update.rs | 2 +- epp-client/src/domain/check.rs | 2 +- epp-client/src/domain/create.rs | 2 +- epp-client/src/domain/delete.rs | 2 +- epp-client/src/domain/info.rs | 2 +- epp-client/src/domain/renew.rs | 2 +- epp-client/src/domain/transfer.rs | 10 +++++----- epp-client/src/domain/update.rs | 2 +- epp-client/src/extensions/namestore.rs | 2 +- epp-client/src/extensions/rgp/report.rs | 2 +- epp-client/src/extensions/rgp/request.rs | 2 +- epp-client/src/host/check.rs | 2 +- epp-client/src/host/create.rs | 2 +- epp-client/src/host/delete.rs | 2 +- epp-client/src/host/info.rs | 2 +- epp-client/src/host/update.rs | 2 +- epp-client/src/lib.rs | 2 +- epp-client/src/login.rs | 6 ++---- epp-client/src/message/ack.rs | 2 +- epp-client/src/message/poll.rs | 2 +- epp-client/src/tests/se.rs | 2 +- 27 files changed, 32 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 4207041..54159f8 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ async fn main() { Err(e) => panic!("Failed to create EppClient: {}", e) }; - let login = Login::::new("username", "password", &None); + let login = Login::::new("username", "password", None); client.transact(login, "transaction-id").await.unwrap(); // Create an DomainCheck instance diff --git a/epp-client/README.md b/epp-client/README.md index 4207041..54159f8 100644 --- a/epp-client/README.md +++ b/epp-client/README.md @@ -80,7 +80,7 @@ async fn main() { Err(e) => panic!("Failed to create EppClient: {}", e) }; - let login = Login::::new("username", "password", &None); + let login = Login::::new("username", "password", None); client.transact(login, "transaction-id").await.unwrap(); // Create an DomainCheck instance diff --git a/epp-client/src/contact/check.rs b/epp-client/src/contact/check.rs index 6cc90d7..8f2fed7 100644 --- a/epp-client/src/contact/check.rs +++ b/epp-client/src/contact/check.rs @@ -57,7 +57,7 @@ impl EppRequest for ContactCheck { /// Err(e) => panic!("Failed to create EppClient: {}", e) /// }; /// -/// let login = Login::::new("username", "password", &None); +/// let login = Login::::new("username", "password", None); /// client.transact(login, "transaction-id").await.unwrap(); /// /// // Create an ContactCheck instance diff --git a/epp-client/src/contact/create.rs b/epp-client/src/contact/create.rs index cf7bb99..6f13d1a 100644 --- a/epp-client/src/contact/create.rs +++ b/epp-client/src/contact/create.rs @@ -57,7 +57,7 @@ impl EppRequest for ContactCreate { /// Err(e) => panic!("Failed to create EppClient: {}", e) /// }; /// -/// let login = Login::::new("username", "password", &None); +/// let login = Login::::new("username", "password", None); /// client.transact(login, "transaction-id").await.unwrap(); /// /// // Create the address, postal_info, voice instances diff --git a/epp-client/src/contact/delete.rs b/epp-client/src/contact/delete.rs index 610ba33..ea98ff3 100644 --- a/epp-client/src/contact/delete.rs +++ b/epp-client/src/contact/delete.rs @@ -57,7 +57,7 @@ impl EppRequest for ContactDelete { /// Err(e) => panic!("Failed to create EppClient: {}", e) /// }; /// -/// let login = Login::::new("username", "password", &None); +/// let login = Login::::new("username", "password", None); /// client.transact(login, "transaction-id").await.unwrap(); /// /// // Create an ContactDelete instance diff --git a/epp-client/src/contact/info.rs b/epp-client/src/contact/info.rs index 13d31c5..e904c36 100644 --- a/epp-client/src/contact/info.rs +++ b/epp-client/src/contact/info.rs @@ -58,7 +58,7 @@ impl EppRequest for ContactInfo { /// Err(e) => panic!("Failed to create EppClient: {}", e) /// }; /// -/// let login = Login::::new("username", "password", &None); +/// let login = Login::::new("username", "password", None); /// client.transact(login, "transaction-id").await.unwrap(); /// /// // Create an ContactInfo instance diff --git a/epp-client/src/contact/update.rs b/epp-client/src/contact/update.rs index 73a11c6..755be4d 100644 --- a/epp-client/src/contact/update.rs +++ b/epp-client/src/contact/update.rs @@ -60,7 +60,7 @@ impl EppRequest for ContactUpdate { /// Err(e) => panic!("Failed to create EppClient: {}", e) /// }; /// -/// let login = Login::::new("username", "password", &None); +/// let login = Login::::new("username", "password", None); /// client.transact(login, "transaction-id").await.unwrap(); /// /// // Create an ContactUpdate instance diff --git a/epp-client/src/domain/check.rs b/epp-client/src/domain/check.rs index 7205c2f..42011cc 100644 --- a/epp-client/src/domain/check.rs +++ b/epp-client/src/domain/check.rs @@ -56,7 +56,7 @@ impl EppRequest for DomainCheck { /// Err(e) => panic!("Failed to create EppClient: {}", e) /// }; /// -/// let login = Login::::new("username", "password", &None); +/// let login = Login::::new("username", "password", None); /// client.transact(login, "transaction-id").await.unwrap(); /// /// // Create an DomainCheck instance diff --git a/epp-client/src/domain/create.rs b/epp-client/src/domain/create.rs index 73d684e..c78b2c9 100644 --- a/epp-client/src/domain/create.rs +++ b/epp-client/src/domain/create.rs @@ -63,7 +63,7 @@ impl EppRequest for DomainCreate { /// Err(e) => panic!("Failed to create EppClient: {}", e) /// }; /// -/// let login = Login::::new("username", "password", &None); +/// let login = Login::::new("username", "password", None); /// client.transact(login, "transaction-id").await.unwrap(); /// /// let contacts = vec![ diff --git a/epp-client/src/domain/delete.rs b/epp-client/src/domain/delete.rs index 488497c..2d4b8a1 100644 --- a/epp-client/src/domain/delete.rs +++ b/epp-client/src/domain/delete.rs @@ -57,7 +57,7 @@ impl EppRequest for DomainDelete { /// Err(e) => panic!("Failed to create EppClient: {}", e) /// }; /// -/// let login = Login::::new("username", "password", &None); +/// let login = Login::::new("username", "password", None); /// client.transact(login, "transaction-id").await.unwrap(); /// /// // Create an DomainDelete instance diff --git a/epp-client/src/domain/info.rs b/epp-client/src/domain/info.rs index cbf4b09..5b43a54 100644 --- a/epp-client/src/domain/info.rs +++ b/epp-client/src/domain/info.rs @@ -58,7 +58,7 @@ impl EppRequest for DomainInfo { /// Err(e) => panic!("Failed to create EppClient: {}", e) /// }; /// -/// let login = Login::::new("username", "password", &None); +/// let login = Login::::new("username", "password", None); /// client.transact(login, "transaction-id").await.unwrap(); /// /// // Create an DomainInfo instance diff --git a/epp-client/src/domain/renew.rs b/epp-client/src/domain/renew.rs index 16893fe..e5a82bd 100644 --- a/epp-client/src/domain/renew.rs +++ b/epp-client/src/domain/renew.rs @@ -59,7 +59,7 @@ impl EppRequest for DomainRenew { /// Err(e) => panic!("Failed to create EppClient: {}", e) /// }; /// -/// let login = Login::::new("username", "password", &None); +/// let login = Login::::new("username", "password", None); /// client.transact(login, "transaction-id").await.unwrap(); /// /// // Create a date object to set the current expiry date diff --git a/epp-client/src/domain/transfer.rs b/epp-client/src/domain/transfer.rs index b109a26..8f8e9d2 100644 --- a/epp-client/src/domain/transfer.rs +++ b/epp-client/src/domain/transfer.rs @@ -117,7 +117,7 @@ impl EppRequest for DomainTransferQuery { /// Err(e) => panic!("Failed to create EppClient: {}", e) /// }; /// -/// let login = Login::::new("username", "password", &None); +/// let login = Login::::new("username", "password", None); /// client.transact(login, "transaction-id").await.unwrap(); /// /// // Create an DomainTransferRequest instance @@ -192,7 +192,7 @@ impl DomainTransferRequest { /// Err(e) => panic!("Failed to create EppClient: {}", e) /// }; /// -/// let login = Login::::new("username", "password", &None); +/// let login = Login::::new("username", "password", None); /// client.transact(login, "transaction-id").await.unwrap(); /// /// // Create an instance of EppClient, passing the config and the registry you want to connect to @@ -273,7 +273,7 @@ impl DomainTransferApprove { /// Err(e) => panic!("Failed to create EppClient: {}", e) /// }; /// -/// let login = Login::::new("username", "password", &None); +/// let login = Login::::new("username", "password", None); /// client.transact(login, "transaction-id").await.unwrap(); /// /// // Create an DomainTransferReject instance @@ -348,7 +348,7 @@ impl DomainTransferReject { /// Err(e) => panic!("Failed to create EppClient: {}", e) /// }; /// -/// let login = Login::::new("username", "password", &None); +/// let login = Login::::new("username", "password", None); /// client.transact(login, "transaction-id").await.unwrap(); /// /// // Create an DomainTransferCancel instance @@ -423,7 +423,7 @@ impl DomainTransferCancel { /// Err(e) => panic!("Failed to create EppClient: {}", e) /// }; /// -/// let login = Login::::new("username", "password", &None); +/// let login = Login::::new("username", "password", None); /// client.transact(login, "transaction-id").await.unwrap(); /// /// // Create an DomainTransferQuery instance diff --git a/epp-client/src/domain/update.rs b/epp-client/src/domain/update.rs index fffa78b..f359cce 100644 --- a/epp-client/src/domain/update.rs +++ b/epp-client/src/domain/update.rs @@ -66,7 +66,7 @@ impl EppRequest for DomainUpdate { /// Err(e) => panic!("Failed to create EppClient: {}", e) /// }; /// -/// let login = Login::::new("username", "password", &None); +/// let login = Login::::new("username", "password", None); /// client.transact(login, "transaction-id").await.unwrap(); /// /// // Create an DomainUpdate instance diff --git a/epp-client/src/extensions/namestore.rs b/epp-client/src/extensions/namestore.rs index 35d3cfc..01e3607 100644 --- a/epp-client/src/extensions/namestore.rs +++ b/epp-client/src/extensions/namestore.rs @@ -45,7 +45,7 @@ pub const XMLNS: &str = "http://www.verisign-grs.com/epp/namestoreExt-1.1"; /// Err(e) => panic!("Failed to create EppClient: {}", e) /// }; /// -/// let login = Login::::new("username", "password", &None); +/// let login = Login::::new("username", "password", None); /// client.transact(login, "transaction-id").await.unwrap(); /// /// let namestore_ext = NameStore::new("com"); diff --git a/epp-client/src/extensions/rgp/report.rs b/epp-client/src/extensions/rgp/report.rs index d75386c..e10a271 100644 --- a/epp-client/src/extensions/rgp/report.rs +++ b/epp-client/src/extensions/rgp/report.rs @@ -47,7 +47,7 @@ use super::EPP_DOMAIN_RGP_EXT_XMLNS; /// Err(e) => panic!("Failed to create EppClient: {}", e) /// }; /// -/// let login = Login::::new("username", "password", &None); +/// let login = Login::::new("username", "password", None); /// client.transact(login, "transaction-id").await.unwrap(); /// /// let pre_data = diff --git a/epp-client/src/extensions/rgp/request.rs b/epp-client/src/extensions/rgp/request.rs index aea78c9..7d10fac 100644 --- a/epp-client/src/extensions/rgp/request.rs +++ b/epp-client/src/extensions/rgp/request.rs @@ -45,7 +45,7 @@ use super::EPP_DOMAIN_RGP_EXT_XMLNS; /// Err(e) => panic!("Failed to create EppClient: {}", e) /// }; /// -/// let login = Login::::new("username", "password", &None); +/// let login = Login::::new("username", "password", None); /// client.transact(login, "transaction-id").await.unwrap(); /// /// // Create an RgpRestoreRequest instance diff --git a/epp-client/src/host/check.rs b/epp-client/src/host/check.rs index a5e417d..727ee5e 100644 --- a/epp-client/src/host/check.rs +++ b/epp-client/src/host/check.rs @@ -58,7 +58,7 @@ impl EppRequest for HostCheck { /// Err(e) => panic!("Failed to create EppClient: {}", e) /// }; /// -/// let login = Login::::new("username", "password", &None); +/// let login = Login::::new("username", "password", None); /// client.transact(login, "transaction-id").await.unwrap(); /// /// // Create an HostCheck instance diff --git a/epp-client/src/host/create.rs b/epp-client/src/host/create.rs index bebd794..922fc1f 100644 --- a/epp-client/src/host/create.rs +++ b/epp-client/src/host/create.rs @@ -57,7 +57,7 @@ impl EppRequest for HostCreate { /// Err(e) => panic!("Failed to create EppClient: {}", e) /// }; /// -/// let login = Login::::new("username", "password", &None); +/// let login = Login::::new("username", "password", None); /// client.transact(login, "transaction-id").await.unwrap(); /// /// // Create a vector of IP addresses to assign to the host diff --git a/epp-client/src/host/delete.rs b/epp-client/src/host/delete.rs index 4eef93e..6be530a 100644 --- a/epp-client/src/host/delete.rs +++ b/epp-client/src/host/delete.rs @@ -57,7 +57,7 @@ impl EppRequest for HostDelete { /// Err(e) => panic!("Failed to create EppClient: {}", e) /// }; /// -/// let login = Login::::new("username", "password", &None); +/// let login = Login::::new("username", "password", None); /// client.transact(login, "transaction-id").await.unwrap(); /// /// // Create an HostDelete instance diff --git a/epp-client/src/host/info.rs b/epp-client/src/host/info.rs index 7f5475a..07dddc8 100644 --- a/epp-client/src/host/info.rs +++ b/epp-client/src/host/info.rs @@ -56,7 +56,7 @@ impl EppRequest for HostInfo { /// Err(e) => panic!("Failed to create EppClient: {}", e) /// }; /// -/// let login = Login::::new("username", "password", &None); +/// let login = Login::::new("username", "password", None); /// client.transact(login, "transaction-id").await.unwrap(); /// /// // Create an HostInfo instance diff --git a/epp-client/src/host/update.rs b/epp-client/src/host/update.rs index a53861a..6837573 100644 --- a/epp-client/src/host/update.rs +++ b/epp-client/src/host/update.rs @@ -58,7 +58,7 @@ impl EppRequest for HostUpdate { /// Err(e) => panic!("Failed to create EppClient: {}", e) /// }; /// -/// let login = Login::::new("username", "password", &None); +/// let login = Login::::new("username", "password", None); /// client.transact(login, "transaction-id").await.unwrap(); /// /// // Create an HostUpdate instance diff --git a/epp-client/src/lib.rs b/epp-client/src/lib.rs index 4d920d5..8f33318 100644 --- a/epp-client/src/lib.rs +++ b/epp-client/src/lib.rs @@ -69,7 +69,7 @@ //! Err(e) => panic!("Failed to create EppClient: {}", e) //! }; //! -//! let login = Login::::new("username", "password", &None); +//! let login = Login::::new("username", "password", None); //! client.transact(login, "transaction-id").await.unwrap(); //! //! // Make a domain check call, which returns an object of type EppDomainCheckResponse diff --git a/epp-client/src/login.rs b/epp-client/src/login.rs index 067f740..aefd1c9 100644 --- a/epp-client/src/login.rs +++ b/epp-client/src/login.rs @@ -29,11 +29,9 @@ impl Login { pub fn new( username: &str, password: &str, - ext_uris: &Option>, + ext_uris: Option>, ) -> Login { - let ext_uris = ext_uris - .as_ref() - .map(|uris| uris.iter().map(|u| u.as_str().into()).collect()); + let ext_uris = ext_uris.map(|uris| uris.iter().map(|u| u.as_str().into()).collect()); Login { request: LoginRequest { diff --git a/epp-client/src/message/ack.rs b/epp-client/src/message/ack.rs index fd19844..568c2b4 100644 --- a/epp-client/src/message/ack.rs +++ b/epp-client/src/message/ack.rs @@ -54,7 +54,7 @@ impl EppRequest for MessageAck { /// Err(e) => panic!("Failed to create EppClient: {}", e) /// }; /// -/// let login = Login::::new("username", "password", &None); +/// let login = Login::::new("username", "password", None); /// client.transact(login, "transaction-id").await.unwrap(); /// /// // Create an MessageAck instance diff --git a/epp-client/src/message/poll.rs b/epp-client/src/message/poll.rs index 932b94b..feb4bf8 100644 --- a/epp-client/src/message/poll.rs +++ b/epp-client/src/message/poll.rs @@ -55,7 +55,7 @@ impl EppRequest for MessagePoll { /// Err(e) => panic!("Failed to create EppClient: {}", e) /// }; /// -/// let login = Login::::new("username", "password", &None); +/// let login = Login::::new("username", "password", None); /// client.transact(login, "transaction-id").await.unwrap(); /// /// // Create an MessagePoll instance diff --git a/epp-client/src/tests/se.rs b/epp-client/src/tests/se.rs index 8451001..b587795 100644 --- a/epp-client/src/tests/se.rs +++ b/epp-client/src/tests/se.rs @@ -64,7 +64,7 @@ mod request { ]); let xml = get_xml("request/login.xml").unwrap(); - let object = Login::::new("username", "password", &ext_uris); + let object = Login::::new("username", "password", ext_uris); let serialized = object.serialize_request(CLTRID).unwrap(); assert_eq!(xml, serialized);