fix: clippy

This commit is contained in:
Yujia Qiao 2023-03-27 10:47:18 +08:00
parent 9479b9a3a9
commit 2acd62454d
No known key found for this signature in database
GPG Key ID: DC129173B148701B
1 changed files with 5 additions and 12 deletions

View File

@ -40,8 +40,9 @@ impl From<&str> for MaskedString {
}
}
#[derive(Debug, Serialize, Deserialize, Copy, Clone, PartialEq, Eq)]
#[derive(Debug, Serialize, Deserialize, Copy, Clone, PartialEq, Eq, Default)]
pub enum TransportType {
#[default]
#[serde(rename = "tcp")]
Tcp,
#[serde(rename = "tls")]
@ -50,12 +51,6 @@ pub enum TransportType {
Noise,
}
impl Default for TransportType {
fn default() -> TransportType {
TransportType::Tcp
}
}
/// Per service config
/// All Option are optional in configuration but must be Some value in runtime
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, Default)]
@ -81,18 +76,16 @@ impl ClientServiceConfig {
}
#[derive(Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
#[derive(Default)]
pub enum ServiceType {
#[serde(rename = "tcp")]
#[default]
Tcp,
#[serde(rename = "udp")]
Udp,
}
impl Default for ServiceType {
fn default() -> Self {
ServiceType::Tcp
}
}
fn default_service_type() -> ServiceType {
Default::default()