Skip to content

Commit

Permalink
Fix cargo clippy feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
brocaar committed Jul 10, 2024
1 parent 92ec502 commit 9d36cc8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
20 changes: 15 additions & 5 deletions src/backend/semtech_udp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,21 @@ async fn handle_push_data(state: &Arc<State>, data: &[u8], remote: &SocketAddr)
let s = state.export_stats().await?;
stats.rx_packets_received_ok = s.rx_packets_received_ok;
stats.tx_packets_emitted = s.tx_packets_emitted;
stats.rx_packets_per_frequency = s.rx_packets_per_frequency.clone();
stats.tx_packets_per_frequency = s.tx_packets_per_frequency.clone();
stats.rx_packets_per_modulation = s.rx_packets_per_modulation.clone();
stats.tx_packets_per_modulation = s.tx_packets_per_modulation.clone();
stats.tx_packets_per_status = s.tx_packets_per_status.clone();
stats
.rx_packets_per_frequency
.clone_from(&s.rx_packets_per_frequency);
stats
.tx_packets_per_frequency
.clone_from(&s.tx_packets_per_frequency);
stats
.rx_packets_per_modulation
.clone_from(&s.rx_packets_per_modulation);
stats
.tx_packets_per_modulation
.clone_from(&s.tx_packets_per_modulation);
stats
.tx_packets_per_status
.clone_from(&s.tx_packets_per_status);
stats.metadata.extend(metadata::get().await?);

send_gateway_stats(&stats).await?;
Expand Down
4 changes: 2 additions & 2 deletions src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ pub fn setup(conf: &Configuration) -> Result<()> {

let mut metadata_w = metadata.write().unwrap();
let mut commands_w = commands.write().unwrap();
*metadata_w = conf.metadata.r#static.clone();
*commands_w = conf.metadata.commands.clone();
metadata_w.clone_from(&conf.metadata.r#static);
commands_w.clone_from(&conf.metadata.commands);

Ok(())
}
Expand Down

0 comments on commit 9d36cc8

Please sign in to comment.