Skip to content

Commit 9d36cc8

Browse files
committed
Fix cargo clippy feedback.
1 parent 92ec502 commit 9d36cc8

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

src/backend/semtech_udp/mod.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -388,11 +388,21 @@ async fn handle_push_data(state: &Arc<State>, data: &[u8], remote: &SocketAddr)
388388
let s = state.export_stats().await?;
389389
stats.rx_packets_received_ok = s.rx_packets_received_ok;
390390
stats.tx_packets_emitted = s.tx_packets_emitted;
391-
stats.rx_packets_per_frequency = s.rx_packets_per_frequency.clone();
392-
stats.tx_packets_per_frequency = s.tx_packets_per_frequency.clone();
393-
stats.rx_packets_per_modulation = s.rx_packets_per_modulation.clone();
394-
stats.tx_packets_per_modulation = s.tx_packets_per_modulation.clone();
395-
stats.tx_packets_per_status = s.tx_packets_per_status.clone();
391+
stats
392+
.rx_packets_per_frequency
393+
.clone_from(&s.rx_packets_per_frequency);
394+
stats
395+
.tx_packets_per_frequency
396+
.clone_from(&s.tx_packets_per_frequency);
397+
stats
398+
.rx_packets_per_modulation
399+
.clone_from(&s.rx_packets_per_modulation);
400+
stats
401+
.tx_packets_per_modulation
402+
.clone_from(&s.tx_packets_per_modulation);
403+
stats
404+
.tx_packets_per_status
405+
.clone_from(&s.tx_packets_per_status);
396406
stats.metadata.extend(metadata::get().await?);
397407

398408
send_gateway_stats(&stats).await?;

src/metadata.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ pub fn setup(conf: &Configuration) -> Result<()> {
1717

1818
let mut metadata_w = metadata.write().unwrap();
1919
let mut commands_w = commands.write().unwrap();
20-
*metadata_w = conf.metadata.r#static.clone();
21-
*commands_w = conf.metadata.commands.clone();
20+
metadata_w.clone_from(&conf.metadata.r#static);
21+
commands_w.clone_from(&conf.metadata.commands);
2222

2323
Ok(())
2424
}

0 commit comments

Comments
 (0)