From 9063f88c43293f19f3400f0ed97b3a301f13ef5b Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 22 Jul 2022 08:23:41 +0200 Subject: Fix clippy in tedge_mapper: Remove let-unit-value This patch fixes `clippy::let_unit_value`. Signed-off-by: Matthias Beyer --- crates/core/tedge_mapper/src/az/converter.rs | 4 ++-- crates/core/tedge_mapper/src/c8y/converter.rs | 10 +++++----- crates/core/tedge_mapper/src/c8y/mapper.rs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/core/tedge_mapper/src/az/converter.rs b/crates/core/tedge_mapper/src/az/converter.rs index f7f4b7a9..b9da5b31 100644 --- a/crates/core/tedge_mapper/src/az/converter.rs +++ b/crates/core/tedge_mapper/src/az/converter.rs @@ -41,10 +41,10 @@ impl Converter for AzureConverter { } async fn try_convert(&mut self, input: &Message) -> Result, Self::Error> { - let () = self.size_threshold.validate(input)?; + self.size_threshold.validate(input)?; let default_timestamp = self.add_timestamp.then(|| self.clock.now()); let mut serializer = ThinEdgeJsonSerializer::new_with_timestamp(default_timestamp); - let () = thin_edge_json::parser::parse_str(input.payload_str()?, &mut serializer)?; + thin_edge_json::parser::parse_str(input.payload_str()?, &mut serializer)?; let payload = serializer.into_string()?; Ok(vec![(Message::new(&self.mapper_config.out_topic, payload))]) diff --git a/crates/core/tedge_mapper/src/c8y/converter.rs b/crates/core/tedge_mapper/src/c8y/converter.rs index 03123697..8a3b7197 100644 --- a/crates/core/tedge_mapper/src/c8y/converter.rs +++ b/crates/core/tedge_mapper/src/c8y/converter.rs @@ -99,7 +99,7 @@ where .try_into() .expect("topics that mapper should subscribe to"); - let () = topic_filter.add_all(CumulocityMapper::subscriptions(&operations).unwrap()); + topic_filter.add_all(CumulocityMapper::subscriptions(&operations).unwrap()); let mapper_config = MapperConfig { in_topic_filter: topic_filter, @@ -153,7 +153,7 @@ where .try_into() .expect("topics that mapper should subscribe to"); - let () = topic_filter.add_all(CumulocityMapper::subscriptions(&operations).unwrap()); + topic_filter.add_all(CumulocityMapper::subscriptions(&operations).unwrap()); let mapper_config = MapperConfig { in_topic_filter: topic_filter, @@ -348,7 +348,7 @@ where async fn try_convert(&mut self, message: &Message) -> Result, ConversionError> { match &message.topic { topic if topic.name.starts_with("tedge/measurements") => { - let () = self.size_threshold.validate(message)?; + self.size_threshold.validate(message)?; self.try_convert_measurement(message) } topic @@ -933,10 +933,10 @@ mod tests { let operation_logs = OperationLogs::try_new(log_dir.path().to_path_buf()).unwrap(); let now = std::time::Instant::now(); - let () = super::execute_operation("5", "sleep", "sleep_one", &operation_logs) + super::execute_operation("5", "sleep", "sleep_one", &operation_logs) .await .unwrap(); - let () = super::execute_operation("5", "sleep", "sleep_two", &operation_logs) + super::execute_operation("5", "sleep", "sleep_two", &operation_logs) .await .unwrap(); diff --git a/crates/core/tedge_mapper/src/c8y/mapper.rs b/crates/core/tedge_mapper/src/c8y/mapper.rs index 502bbc10..f341caa2 100644 --- a/crates/core/tedge_mapper/src/c8y/mapper.rs +++ b/crates/core/tedge_mapper/src/c8y/mapper.rs @@ -225,7 +225,7 @@ mod tests { }); // publish `payload` to `pub_topic` - let () = broker.publish(pub_topic, payload).await?; + broker.publish(pub_topic, payload).await?; // check the `messages` returned contain `expected_msg` assert_received_all_expected(&mut messages, TEST_TIMEOUT_SECS, &[expected_msg]).await; -- cgit v1.2.3