Make clippy happy
This commit is contained in:
parent
42892e12a0
commit
c5fc82491b
|
@ -31,22 +31,20 @@
|
||||||
//! ```rust
|
//! ```rust
|
||||||
//! use epp_client::config::CONFIG;
|
//! use epp_client::config::CONFIG;
|
||||||
//!
|
//!
|
||||||
//! fn main() {
|
//! // Get configuration for the relevant registry section
|
||||||
//! // Get configuration for the relevant registry section
|
//! let registry = CONFIG.registry("verisign").unwrap();
|
||||||
//! let registry = CONFIG.registry("verisign").unwrap();
|
|
||||||
//!
|
//!
|
||||||
//! // Get EPP host name and port no.
|
//! // Get EPP host name and port no.
|
||||||
//! let remote = registry.connection_details();
|
//! let remote = registry.connection_details();
|
||||||
//!
|
//!
|
||||||
//! // Get username and password
|
//! // Get username and password
|
||||||
//! let credentials = registry.credentials();
|
//! let credentials = registry.credentials();
|
||||||
//!
|
//!
|
||||||
//! // Get EPP service extensions
|
//! // Get EPP service extensions
|
||||||
//! let service_extensions = registry.ext_uris().unwrap();
|
//! let service_extensions = registry.ext_uris().unwrap();
|
||||||
//!
|
//!
|
||||||
//! // Get client certificate and private key
|
//! // Get client certificate and private key
|
||||||
//! let tls = registry.tls_files().unwrap();
|
//! let tls = registry.tls_files().unwrap();
|
||||||
//! }
|
|
||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
use confy;
|
use confy;
|
||||||
|
|
|
@ -198,6 +198,6 @@ impl EppClient {
|
||||||
|
|
||||||
impl Drop for EppClient {
|
impl Drop for EppClient {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
block_on(self.logout());
|
let _ = block_on(self.logout());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@ impl EppConnection {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Writes to the socket
|
/// Writes to the socket
|
||||||
async fn write(&mut self, buf: &Vec<u8>) -> Result<(), Box<dyn Error>> {
|
async fn write(&mut self, buf: &[u8]) -> Result<(), Box<dyn Error>> {
|
||||||
let wrote = self.stream.writer.write(buf).await?;
|
let wrote = self.stream.writer.write(buf).await?;
|
||||||
|
|
||||||
debug!("{}: Wrote {} bytes", self.registry, wrote);
|
debug!("{}: Wrote {} bytes", self.registry, wrote);
|
||||||
|
@ -139,7 +139,7 @@ impl EppConnection {
|
||||||
|
|
||||||
impl Drop for EppConnection {
|
impl Drop for EppConnection {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
block_on(self.close());
|
let _ = block_on(self.close());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -212,7 +212,7 @@ impl Address {
|
||||||
) -> Address {
|
) -> Address {
|
||||||
let street = street
|
let street = street
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|s| Some(s.to_string_value()))
|
.map(|s| s.to_string_value())
|
||||||
.collect::<Vec<StringValue>>();
|
.collect::<Vec<StringValue>>();
|
||||||
|
|
||||||
Address {
|
Address {
|
||||||
|
|
|
@ -97,6 +97,12 @@ impl EppHello {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for EppHello {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, PartialEq, ElementName)]
|
#[derive(Serialize, Deserialize, Debug, PartialEq, ElementName)]
|
||||||
#[element_name(name = "login")]
|
#[element_name(name = "login")]
|
||||||
/// Type corresponding to the <login> tag in an EPP XML login request
|
/// Type corresponding to the <login> tag in an EPP XML login request
|
||||||
|
|
|
@ -63,7 +63,7 @@ impl EppContactCheck {
|
||||||
pub fn new(contact_ids: Vec<&str>, client_tr_id: &str) -> EppContactCheck {
|
pub fn new(contact_ids: Vec<&str>, client_tr_id: &str) -> EppContactCheck {
|
||||||
let contact_ids = contact_ids
|
let contact_ids = contact_ids
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|d| Some(d.to_string_value()))
|
.map(|d| d.to_string_value())
|
||||||
.collect::<Vec<StringValue>>();
|
.collect::<Vec<StringValue>>();
|
||||||
|
|
||||||
let contact_check = ContactCheck {
|
let contact_check = ContactCheck {
|
||||||
|
|
|
@ -124,9 +124,8 @@ impl EppContactUpdate {
|
||||||
|
|
||||||
/// Sets the data for the <fax> tag under <chg> for the contact update request
|
/// Sets the data for the <fax> tag under <chg> for the contact update request
|
||||||
pub fn set_fax(&mut self, fax: Phone) {
|
pub fn set_fax(&mut self, fax: Phone) {
|
||||||
match &mut self.data.command.contact.change_info {
|
if let Some(info) = &mut self.data.command.contact.change_info {
|
||||||
Some(ref mut info) => info.fax = Some(fax),
|
info.fax = Some(fax)
|
||||||
_ => (),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ impl EppDomainCheck {
|
||||||
pub fn new(domains: Vec<&str>, client_tr_id: &str) -> EppDomainCheck {
|
pub fn new(domains: Vec<&str>, client_tr_id: &str) -> EppDomainCheck {
|
||||||
let domains = domains
|
let domains = domains
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|d| Some(d.to_string_value()))
|
.map(|d| d.to_string_value())
|
||||||
.collect::<Vec<StringValue>>();
|
.collect::<Vec<StringValue>>();
|
||||||
|
|
||||||
let domain_check = DomainCheck {
|
let domain_check = DomainCheck {
|
||||||
|
|
|
@ -116,6 +116,7 @@ pub struct RgpRestoreReport {
|
||||||
|
|
||||||
impl EppDomainRgpRestoreReport {
|
impl EppDomainRgpRestoreReport {
|
||||||
/// Creates a new EppObject for domain rgp restore report corresponding to the <epp> tag in EPP XML
|
/// 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(
|
pub fn new(
|
||||||
name: &str,
|
name: &str,
|
||||||
pre_data: &str,
|
pre_data: &str,
|
||||||
|
|
|
@ -63,7 +63,7 @@ impl EppHostCheck {
|
||||||
pub fn new(hosts: Vec<&str>, client_tr_id: &str) -> EppHostCheck {
|
pub fn new(hosts: Vec<&str>, client_tr_id: &str) -> EppHostCheck {
|
||||||
let hosts = hosts
|
let hosts = hosts
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|d| Some(d.to_string_value()))
|
.map(|d| d.to_string_value())
|
||||||
.collect::<Vec<StringValue>>();
|
.collect::<Vec<StringValue>>();
|
||||||
|
|
||||||
let host_check = HostCheck {
|
let host_check = HostCheck {
|
||||||
|
|
Loading…
Reference in New Issue