summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorRina Fujino <18257209+rina23q@users.noreply.github.com>2022-04-21 13:06:03 +0200
committerRina Fujino <18257209+rina23q@users.noreply.github.com>2022-04-21 13:06:52 +0200
commitdd71f3084d688459aa1a31361891fb9b3e17c234 (patch)
tree67457bc6c607f5fca23a70cd476ee5b8c4b93604 /plugins
parentc8b1de9422c55d6bfee0e142ed4654e02332e272 (diff)
Reduce code duplication in smartrest_deserializer
Signed-off-by: Rina Fujino <18257209+rina23q@users.noreply.github.com>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/c8y_configuration_plugin/src/download.rs1
-rw-r--r--plugins/c8y_configuration_plugin/src/main.rs4
-rw-r--r--plugins/log_request_plugin/src/main.rs1
-rw-r--r--plugins/log_request_plugin/src/smartrest.rs2
4 files changed, 6 insertions, 2 deletions
diff --git a/plugins/c8y_configuration_plugin/src/download.rs b/plugins/c8y_configuration_plugin/src/download.rs
index 3ff6e80f..c6838ad8 100644
--- a/plugins/c8y_configuration_plugin/src/download.rs
+++ b/plugins/c8y_configuration_plugin/src/download.rs
@@ -213,6 +213,7 @@ impl GetSmartRestMessage for GetDownloadConfigFileMessage {
mod tests {
use super::*;
use assert_matches::*;
+ use c8y_smartrest::smartrest_deserializer::SmartRestRequestGeneric;
#[test]
fn create_config_download_request() -> Result<(), anyhow::Error> {
diff --git a/plugins/c8y_configuration_plugin/src/main.rs b/plugins/c8y_configuration_plugin/src/main.rs
index 15e9a1cd..e9b4649b 100644
--- a/plugins/c8y_configuration_plugin/src/main.rs
+++ b/plugins/c8y_configuration_plugin/src/main.rs
@@ -9,7 +9,9 @@ use crate::download::handle_config_download_request;
use crate::upload::handle_config_upload_request;
use anyhow::Result;
use c8y_api::http_proxy::{C8YHttpProxy, JwtAuthHttpProxy};
-use c8y_smartrest::smartrest_deserializer::SmartRestConfigDownloadRequest;
+use c8y_smartrest::smartrest_deserializer::{
+ SmartRestConfigDownloadRequest, SmartRestRequestGeneric,
+};
use c8y_smartrest::{smartrest_deserializer::SmartRestConfigUploadRequest, topic::C8yTopic};
use mqtt_channel::{SinkExt, StreamExt};
use std::path::PathBuf;
diff --git a/plugins/log_request_plugin/src/main.rs b/plugins/log_request_plugin/src/main.rs
index a60a0092..d448124b 100644
--- a/plugins/log_request_plugin/src/main.rs
+++ b/plugins/log_request_plugin/src/main.rs
@@ -4,6 +4,7 @@ use c8y_api::http_proxy::{C8YHttpProxy, JwtAuthHttpProxy};
use c8y_smartrest::{smartrest_deserializer::SmartRestLogRequest, topic::C8yTopic};
use tedge_config::{get_tedge_config, ConfigSettingAccessor, MqttPortSetting};
+use c8y_smartrest::smartrest_deserializer::SmartRestRequestGeneric;
use futures::SinkExt;
use smartrest::{
diff --git a/plugins/log_request_plugin/src/smartrest.rs b/plugins/log_request_plugin/src/smartrest.rs
index 3b154a44..e06666d8 100644
--- a/plugins/log_request_plugin/src/smartrest.rs
+++ b/plugins/log_request_plugin/src/smartrest.rs
@@ -112,7 +112,7 @@ pub fn read_tedge_logs(
#[cfg(test)]
mod tests {
use super::read_tedge_logs;
- use c8y_smartrest::smartrest_deserializer::SmartRestLogRequest;
+ use c8y_smartrest::smartrest_deserializer::{SmartRestLogRequest, SmartRestRequestGeneric};
use std::fs::File;
use std::io::Write;