Skip to content

Commit

Permalink
Run cargo clippy & fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisOSRM committed Nov 30, 2023
1 parent eea0834 commit d639b04
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion hms2mqtt/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pub mod home_assistant_config;
pub mod home_assistant;
pub mod home_assistant_config;
pub mod inverter;
pub mod metric_collector;
pub mod mqtt_config;
Expand Down
14 changes: 8 additions & 6 deletions src/rumqttc_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,18 @@ impl mqtt_wrapper::MqttWrapper for RumqttcWrapper {
V: Clone + Into<Vec<u8>>,
{
// try publishing up to three times
if let std::result::Result::Ok(_) =
self.client
.try_publish(topic.clone(), match_qos(qos), retain, payload.clone())
if self
.client
.try_publish(topic.clone(), match_qos(qos), retain, payload.clone())
.is_ok()
{
return Ok(());
}
std::thread::sleep(Duration::from_millis(100));
if let std::result::Result::Ok(_) =
self.client
.try_publish(topic.clone(), match_qos(qos), retain, payload.clone())
if self
.client
.try_publish(topic.clone(), match_qos(qos), retain, payload.clone())
.is_ok()
{
return Ok(());
}
Expand Down

0 comments on commit d639b04

Please sign in to comment.