diff options
author | 2023-03-27 10:47:18 +0800 | |
---|---|---|
committer | 2023-03-27 10:48:12 +0800 | |
commit | 2acd62454d1906c4f2c2bb8898217bd154965fc2 (patch) | |
tree | 983eb02bd313fc90d48b0d24014ee9a75a030d06 | |
parent | 9479b9a3a9c426a9ee04175cbd747b49a520d497 (diff) | |
download | rathole-2acd62454d1906c4f2c2bb8898217bd154965fc2.tar.gz rathole-2acd62454d1906c4f2c2bb8898217bd154965fc2.tar.zst rathole-2acd62454d1906c4f2c2bb8898217bd154965fc2.zip |
fix: clippy
-rw-r--r-- | src/config.rs | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/config.rs b/src/config.rs index 74015ed..aa7f396 100644 --- a/src/config.rs +++ b/src/config.rs @@ -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() |