diff --git a/epp-client/src/config.rs b/epp-client/src/config.rs index a8762f6..a894d0f 100644 --- a/epp-client/src/config.rs +++ b/epp-client/src/config.rs @@ -31,22 +31,20 @@ //! ```rust //! use epp_client::config::CONFIG; //! -//! fn main() { -//! // Get configuration for the relevant registry section -//! let registry = CONFIG.registry("verisign").unwrap(); +//! // Get configuration for the relevant registry section +//! let registry = CONFIG.registry("verisign").unwrap(); //! -//! // Get EPP host name and port no. -//! let remote = registry.connection_details(); +//! // Get EPP host name and port no. +//! let remote = registry.connection_details(); //! -//! // Get username and password -//! let credentials = registry.credentials(); +//! // Get username and password +//! let credentials = registry.credentials(); //! -//! // Get EPP service extensions -//! let service_extensions = registry.ext_uris().unwrap(); +//! // Get EPP service extensions +//! let service_extensions = registry.ext_uris().unwrap(); //! -//! // Get client certificate and private key -//! let tls = registry.tls_files().unwrap(); -//! } +//! // Get client certificate and private key +//! let tls = registry.tls_files().unwrap(); //! ``` use confy; diff --git a/epp-client/src/connection/client.rs b/epp-client/src/connection/client.rs index 1bc74fd..980494c 100644 --- a/epp-client/src/connection/client.rs +++ b/epp-client/src/connection/client.rs @@ -198,6 +198,6 @@ impl EppClient { impl Drop for EppClient { fn drop(&mut self) { - block_on(self.logout()); + let _ = block_on(self.logout()); } } diff --git a/epp-client/src/connection/registry.rs b/epp-client/src/connection/registry.rs index 177a5aa..a76151f 100644 --- a/epp-client/src/connection/registry.rs +++ b/epp-client/src/connection/registry.rs @@ -48,7 +48,7 @@ impl EppConnection { } /// Writes to the socket - async fn write(&mut self, buf: &Vec) -> Result<(), Box> { + async fn write(&mut self, buf: &[u8]) -> Result<(), Box> { let wrote = self.stream.writer.write(buf).await?; debug!("{}: Wrote {} bytes", self.registry, wrote); @@ -139,7 +139,7 @@ impl EppConnection { impl Drop for EppConnection { fn drop(&mut self) { - block_on(self.close()); + let _ = block_on(self.close()); } } diff --git a/epp-client/src/epp/object/data.rs b/epp-client/src/epp/object/data.rs index 874e40d..c1e22a0 100644 --- a/epp-client/src/epp/object/data.rs +++ b/epp-client/src/epp/object/data.rs @@ -212,7 +212,7 @@ impl Address { ) -> Address { let street = street .iter() - .filter_map(|s| Some(s.to_string_value())) + .map(|s| s.to_string_value()) .collect::>(); Address { diff --git a/epp-client/src/epp/request.rs b/epp-client/src/epp/request.rs index 878a2fe..389893f 100644 --- a/epp-client/src/epp/request.rs +++ b/epp-client/src/epp/request.rs @@ -97,6 +97,12 @@ impl EppHello { } } +impl Default for EppHello { + fn default() -> Self { + Self::new() + } +} + #[derive(Serialize, Deserialize, Debug, PartialEq, ElementName)] #[element_name(name = "login")] /// Type corresponding to the <login> tag in an EPP XML login request diff --git a/epp-client/src/epp/request/contact/check.rs b/epp-client/src/epp/request/contact/check.rs index 497e5c3..5d8841c 100644 --- a/epp-client/src/epp/request/contact/check.rs +++ b/epp-client/src/epp/request/contact/check.rs @@ -63,7 +63,7 @@ impl EppContactCheck { pub fn new(contact_ids: Vec<&str>, client_tr_id: &str) -> EppContactCheck { let contact_ids = contact_ids .iter() - .filter_map(|d| Some(d.to_string_value())) + .map(|d| d.to_string_value()) .collect::>(); let contact_check = ContactCheck { diff --git a/epp-client/src/epp/request/contact/update.rs b/epp-client/src/epp/request/contact/update.rs index e707ca1..f8935c1 100644 --- a/epp-client/src/epp/request/contact/update.rs +++ b/epp-client/src/epp/request/contact/update.rs @@ -124,9 +124,8 @@ impl EppContactUpdate { /// Sets the data for the <fax> tag under <chg> for the contact update request pub fn set_fax(&mut self, fax: Phone) { - match &mut self.data.command.contact.change_info { - Some(ref mut info) => info.fax = Some(fax), - _ => (), + if let Some(info) = &mut self.data.command.contact.change_info { + info.fax = Some(fax) } } diff --git a/epp-client/src/epp/request/domain/check.rs b/epp-client/src/epp/request/domain/check.rs index 8d4fdf3..6e3acc4 100644 --- a/epp-client/src/epp/request/domain/check.rs +++ b/epp-client/src/epp/request/domain/check.rs @@ -63,7 +63,7 @@ impl EppDomainCheck { pub fn new(domains: Vec<&str>, client_tr_id: &str) -> EppDomainCheck { let domains = domains .iter() - .filter_map(|d| Some(d.to_string_value())) + .map(|d| d.to_string_value()) .collect::>(); let domain_check = DomainCheck { diff --git a/epp-client/src/epp/request/domain/rgp/report.rs b/epp-client/src/epp/request/domain/rgp/report.rs index 790868c..3c5c5df 100644 --- a/epp-client/src/epp/request/domain/rgp/report.rs +++ b/epp-client/src/epp/request/domain/rgp/report.rs @@ -116,6 +116,7 @@ pub struct RgpRestoreReport { impl EppDomainRgpRestoreReport { /// Creates a new EppObject for domain rgp restore report corresponding to the <epp> tag in EPP XML + #[allow(clippy::too_many_arguments)] pub fn new( name: &str, pre_data: &str, diff --git a/epp-client/src/epp/request/host/check.rs b/epp-client/src/epp/request/host/check.rs index 7b3e83a..7a3116b 100644 --- a/epp-client/src/epp/request/host/check.rs +++ b/epp-client/src/epp/request/host/check.rs @@ -63,7 +63,7 @@ impl EppHostCheck { pub fn new(hosts: Vec<&str>, client_tr_id: &str) -> EppHostCheck { let hosts = hosts .iter() - .filter_map(|d| Some(d.to_string_value())) + .map(|d| d.to_string_value()) .collect::>(); let host_check = HostCheck {