diff options
author | Lukasz Woznicki <75632179+makr11st@users.noreply.github.com> | 2021-05-14 08:51:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-14 08:51:55 +0100 |
commit | 72ad78966ba72a44313c4420da58601e29f5658e (patch) | |
tree | 992e3e3b308f5eb1471b710bc2e1e2700b148216 /tedge_config | |
parent | d8d9fa87020627426d6ac6a262b2e6014526e300 (diff) |
Fix clippy warnings (#223)
* clippy: fix warnings
Diffstat (limited to 'tedge_config')
-rw-r--r-- | tedge_config/src/models/connect_url.rs | 12 | ||||
-rw-r--r-- | tedge_config/src/models/file_path.rs | 6 | ||||
-rw-r--r-- | tedge_config/src/tedge_config_dto.rs | 8 |
3 files changed, 10 insertions, 16 deletions
diff --git a/tedge_config/src/models/connect_url.rs b/tedge_config/src/models/connect_url.rs index 05faa35e..79f15629 100644 --- a/tedge_config/src/models/connect_url.rs +++ b/tedge_config/src/models/connect_url.rs @@ -43,15 +43,15 @@ impl ConnectUrl { } } -impl Into<String> for ConnectUrl { - fn into(self) -> String { - self.input +impl From<ConnectUrl> for String { + fn from(val: ConnectUrl) -> Self { + val.input } } -impl Into<Host> for ConnectUrl { - fn into(self) -> Host { - self.host +impl From<ConnectUrl> for Host { + fn from(val: ConnectUrl) -> Self { + val.host } } diff --git a/tedge_config/src/models/file_path.rs b/tedge_config/src/models/file_path.rs index 47ed6a04..3328c6ce 100644 --- a/tedge_config/src/models/file_path.rs +++ b/tedge_config/src/models/file_path.rs @@ -22,12 +22,6 @@ where } } -impl Into<PathBuf> for FilePath { - fn into(self) -> PathBuf { - self.0 - } -} - impl TryInto<String> for FilePath { type Error = FilePathToStringConversionFailure; diff --git a/tedge_config/src/tedge_config_dto.rs b/tedge_config/src/tedge_config_dto.rs index df5533b8..6da6c74c 100644 --- a/tedge_config/src/tedge_config_dto.rs +++ b/tedge_config/src/tedge_config_dto.rs @@ -3,8 +3,8 @@ use crate::*; use serde::{Deserialize, Serialize}; -#[serde(deny_unknown_fields)] #[derive(Debug, Default, Deserialize, Serialize)] +#[serde(deny_unknown_fields)] pub(crate) struct TEdgeConfigDto { /// Captures the device specific configurations #[serde(default)] @@ -19,8 +19,8 @@ pub(crate) struct TEdgeConfigDto { /// Represents the device specific configurations defined in the [device] section /// of the thin edge configuration TOML file -#[serde(deny_unknown_fields)] #[derive(Debug, Default, Deserialize, Serialize)] +#[serde(deny_unknown_fields)] pub(crate) struct DeviceConfigDto { /// The unique id of the device (DEPRECATED) /// This id is now derived from the device certificate @@ -38,8 +38,8 @@ pub(crate) struct DeviceConfigDto { /// Represents the Cumulocity specific configurations defined in the /// [c8y] section of the thin edge configuration TOML file -#[serde(deny_unknown_fields)] #[derive(Debug, Default, Deserialize, Serialize)] +#[serde(deny_unknown_fields)] pub(crate) struct CumulocityConfigDto { /// Preserves the current status of the connection pub(crate) connect: Option<String>, @@ -52,8 +52,8 @@ pub(crate) struct CumulocityConfigDto { pub(crate) root_cert_path: Option<FilePath>, } -#[serde(deny_unknown_fields)] #[derive(Debug, Default, Deserialize, Serialize)] +#[serde(deny_unknown_fields)] pub(crate) struct AzureConfigDto { pub(crate) connect: Option<String>, pub(crate) url: Option<ConnectUrl>, |