summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <matthias.beyer@ifm.com>2022-08-18 15:07:40 +0200
committerMatthias Beyer <matthias.beyer@ifm.com>2022-08-18 15:40:40 +0200
commit6cd599b95bb62c2539b2f7c9940c47a54e53d155 (patch)
treeb9531626588b4cc6df286f3dcc8c114e717cf24e
parent65ced46ffbe325ca85d45a98b0e60dc560f7476a (diff)
Fix clippy: c8y_smartrest: Add derive for Eq
This fixes clippy::derive_partial_eq_without_eq Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
-rw-r--r--crates/core/c8y_smartrest/src/operations.rs4
-rw-r--r--crates/core/c8y_smartrest/src/smartrest_deserializer.rs14
-rw-r--r--crates/core/c8y_smartrest/src/smartrest_serializer.rs14
-rw-r--r--crates/core/c8y_smartrest/src/topic.rs4
4 files changed, 18 insertions, 18 deletions
diff --git a/crates/core/c8y_smartrest/src/operations.rs b/crates/core/c8y_smartrest/src/operations.rs
index ea0202b7..536526c7 100644
--- a/crates/core/c8y_smartrest/src/operations.rs
+++ b/crates/core/c8y_smartrest/src/operations.rs
@@ -11,7 +11,7 @@ use serde::Deserialize;
/// Each operation is a file name in one of the subdirectories
/// The file name is the operation name
-#[derive(Debug, Clone, Deserialize, PartialEq)]
+#[derive(Debug, Clone, Deserialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub struct OnMessageExec {
command: Option<String>,
@@ -20,7 +20,7 @@ pub struct OnMessageExec {
user: Option<String>,
}
-#[derive(Debug, Clone, Deserialize, PartialEq)]
+#[derive(Debug, Clone, Deserialize, Eq, PartialEq)]
#[serde(rename_all = "lowercase")]
pub struct Operation {
#[serde(skip)]
diff --git a/crates/core/c8y_smartrest/src/smartrest_deserializer.rs b/crates/core/c8y_smartrest/src/smartrest_deserializer.rs
index 54e96855..35e42b53 100644
--- a/crates/core/c8y_smartrest/src/smartrest_deserializer.rs
+++ b/crates/core/c8y_smartrest/src/smartrest_deserializer.rs
@@ -29,14 +29,14 @@ impl TryFrom<String> for CumulocitySoftwareUpdateActions {
}
}
-#[derive(Debug, Deserialize, Serialize, PartialEq)]
+#[derive(Debug, Deserialize, Serialize, Eq, PartialEq)]
pub struct SmartRestUpdateSoftware {
pub message_id: String,
pub external_id: String,
pub update_list: Vec<SmartRestUpdateSoftwareModule>,
}
-#[derive(Debug, Deserialize, Serialize, PartialEq)]
+#[derive(Debug, Deserialize, Serialize, Eq, PartialEq)]
pub struct SmartRestUpdateSoftwareModule {
pub software: String,
pub version: Option<String>,
@@ -211,7 +211,7 @@ pub enum SmartRestVariant {
SmartRestLogRequest,
}
-#[derive(Debug, Deserialize, Serialize, PartialEq)]
+#[derive(Debug, Deserialize, Serialize, Eq, PartialEq)]
pub struct SmartRestLogRequest {
pub message_id: String,
pub device: String,
@@ -226,7 +226,7 @@ pub struct SmartRestLogRequest {
impl SmartRestRequestGeneric for SmartRestLogRequest {}
-#[derive(Debug, Deserialize, Serialize, PartialEq)]
+#[derive(Debug, Deserialize, Serialize, Eq, PartialEq)]
pub struct SmartRestRestartRequest {
pub message_id: String,
pub device: String,
@@ -234,7 +234,7 @@ pub struct SmartRestRestartRequest {
impl SmartRestRequestGeneric for SmartRestRestartRequest {}
-#[derive(Debug, Deserialize, Serialize, PartialEq)]
+#[derive(Debug, Deserialize, Serialize, Eq, PartialEq)]
pub struct SmartRestConfigUploadRequest {
pub message_id: String,
pub device: String,
@@ -243,7 +243,7 @@ pub struct SmartRestConfigUploadRequest {
impl SmartRestRequestGeneric for SmartRestConfigUploadRequest {}
-#[derive(Debug, Deserialize, Serialize, PartialEq, Clone)]
+#[derive(Debug, Deserialize, Serialize, Eq, PartialEq, Clone)]
pub struct SmartRestConfigDownloadRequest {
pub message_id: String,
pub device: String,
@@ -255,7 +255,7 @@ impl SmartRestRequestGeneric for SmartRestConfigDownloadRequest {}
type JwtToken = String;
-#[derive(Debug, Deserialize, PartialEq)]
+#[derive(Debug, Deserialize, Eq, PartialEq)]
pub struct SmartRestJwtResponse {
id: u16,
token: JwtToken,
diff --git a/crates/core/c8y_smartrest/src/smartrest_serializer.rs b/crates/core/c8y_smartrest/src/smartrest_serializer.rs
index 4581a2cf..abac4e6e 100644
--- a/crates/core/c8y_smartrest/src/smartrest_serializer.rs
+++ b/crates/core/c8y_smartrest/src/smartrest_serializer.rs
@@ -37,7 +37,7 @@ where
}
}
-#[derive(Debug, Deserialize, Serialize, PartialEq)]
+#[derive(Debug, Deserialize, Serialize, Eq, PartialEq)]
pub struct SmartRestSetSupportedLogType {
pub message_id: &'static str,
pub supported_operations: Vec<String>,
@@ -54,7 +54,7 @@ impl From<Vec<String>> for SmartRestSetSupportedLogType {
impl<'a> SmartRestSerializer<'a> for SmartRestSetSupportedLogType {}
-#[derive(Debug, Deserialize, Serialize, PartialEq)]
+#[derive(Debug, Deserialize, Serialize, Eq, PartialEq)]
pub struct SmartRestSetSupportedOperations<'a> {
pub message_id: &'static str,
pub supported_operations: Vec<&'a str>,
@@ -75,14 +75,14 @@ impl<'a> SmartRestSetSupportedOperations<'a> {
impl<'a> SmartRestSerializer<'a> for SmartRestSetSupportedOperations<'a> {}
-#[derive(Debug, Deserialize, Serialize, PartialEq)]
+#[derive(Debug, Deserialize, Serialize, Eq, PartialEq)]
pub struct SmartRestSoftwareModuleItem {
pub software: String,
pub version: Option<String>,
pub url: Option<String>,
}
-#[derive(Debug, Deserialize, Serialize, PartialEq)]
+#[derive(Debug, Deserialize, Serialize, Eq, PartialEq)]
pub struct SmartRestGetPendingOperations {
pub id: &'static str,
}
@@ -95,7 +95,7 @@ impl Default for SmartRestGetPendingOperations {
impl<'a> SmartRestSerializer<'a> for SmartRestGetPendingOperations {}
-#[derive(Debug, Deserialize, Serialize, PartialEq)]
+#[derive(Debug, Deserialize, Serialize, Eq, PartialEq)]
pub struct SmartRestSetOperationToExecuting {
pub message_id: &'static str,
pub operation: &'static str,
@@ -123,7 +123,7 @@ impl SmartRestSetOperationToExecuting {
impl<'a> SmartRestSerializer<'a> for SmartRestSetOperationToExecuting {}
-#[derive(Debug, Deserialize, Serialize, PartialEq)]
+#[derive(Debug, Deserialize, Serialize, Eq, PartialEq)]
pub struct SmartRestSetOperationToSuccessful {
pub message_id: &'static str,
pub operation: &'static str,
@@ -160,7 +160,7 @@ impl SmartRestSetOperationToSuccessful {
impl<'a> SmartRestSerializer<'a> for SmartRestSetOperationToSuccessful {}
-#[derive(Debug, Deserialize, Serialize, PartialEq)]
+#[derive(Debug, Deserialize, Serialize, Eq, PartialEq)]
pub struct SmartRestSetOperationToFailed {
pub message_id: &'static str,
pub operation: &'static str,
diff --git a/crates/core/c8y_smartrest/src/topic.rs b/crates/core/c8y_smartrest/src/topic.rs
index 7df4f5af..d8faebb7 100644
--- a/crates/core/c8y_smartrest/src/topic.rs
+++ b/crates/core/c8y_smartrest/src/topic.rs
@@ -3,7 +3,7 @@ use agent_interface::TopicError;
use mqtt_channel::MqttError;
use mqtt_channel::Topic;
-#[derive(Debug, Clone, PartialEq)]
+#[derive(Debug, Clone, Eq, PartialEq)]
pub enum C8yTopic {
SmartRestRequest,
SmartRestResponse,
@@ -59,7 +59,7 @@ impl TryFrom<Topic> for C8yTopic {
}
}
-#[derive(Debug, Clone, PartialEq)]
+#[derive(Debug, Clone, Eq, PartialEq)]
pub enum MapperSubscribeTopic {
C8yTopic(C8yTopic),
ResponseTopic(ResponseTopic),