mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-06-23 09:25:25 +00:00
Fix cargo clippy warnings.
This commit is contained in:
@ -583,7 +583,7 @@ impl InternalService for Internal {
|
||||
// update the user
|
||||
// in case it was fetched using the external id, this will make sure we sync with any
|
||||
// possible email change.
|
||||
u.email = oauth_user.email.clone();
|
||||
u.email.clone_from(&oauth_user.email);
|
||||
u.email_verified = email_verified;
|
||||
let u = user::update(u).await.map_err(|e| e.status())?;
|
||||
|
||||
@ -933,14 +933,14 @@ impl InternalService for Internal {
|
||||
|
||||
for region_conf in &conf.regions {
|
||||
if req.id == region_conf.id {
|
||||
out.id = region_conf.id.clone();
|
||||
out.id.clone_from(®ion_conf.id);
|
||||
out.description = if region_conf.description.is_empty() {
|
||||
region_conf.id.clone()
|
||||
} else {
|
||||
region_conf.description.clone()
|
||||
};
|
||||
out.region = region_conf.common_name.to_proto().into();
|
||||
out.user_info = region_conf.user_info.clone();
|
||||
out.user_info.clone_from(®ion_conf.user_info);
|
||||
out.rx1_delay = region_conf.network.rx1_delay as u32;
|
||||
out.rx1_dr_offset = region_conf.network.rx1_dr_offset as u32;
|
||||
out.rx2_dr = region_conf.network.rx2_dr as u32;
|
||||
|
@ -76,7 +76,7 @@ impl Data {
|
||||
.cloned()
|
||||
.ok_or_else(|| anyhow!("rx_info is empty"))?;
|
||||
|
||||
self.downlink_frame.gateway_id = rx_info.gateway_id.clone();
|
||||
self.downlink_frame.gateway_id.clone_from(&rx_info.gateway_id);
|
||||
if self.dl_meta_data.dl_freq_1.is_some()
|
||||
&& self.dl_meta_data.data_rate_1.is_some()
|
||||
&& self.dl_meta_data.rx_delay_1.is_some()
|
||||
|
@ -452,7 +452,7 @@ impl JoinAccept<'_> {
|
||||
|
||||
let phy_b = self.join_accept.to_vec()?;
|
||||
for i in &mut self.downlink_frame.items {
|
||||
i.phy_payload = phy_b.clone();
|
||||
i.phy_payload.clone_from(&phy_b);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
@ -507,7 +507,7 @@ impl JoinAccept<'_> {
|
||||
|
||||
let relay_phy_b = relay_phy.to_vec()?;
|
||||
for i in &mut self.downlink_frame.items {
|
||||
i.phy_payload = relay_phy_b.clone();
|
||||
i.phy_payload.clone_from(&relay_phy_b);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
@ -148,7 +148,7 @@ pub async fn setup() -> Result<()> {
|
||||
|
||||
if !conf.redis.key_prefix.is_empty() {
|
||||
info!(prefix = %conf.redis.key_prefix, "Setting Redis prefix");
|
||||
*REDIS_PREFIX.write().unwrap() = conf.redis.key_prefix.clone();
|
||||
REDIS_PREFIX.write().unwrap().clone_from(&conf.redis.key_prefix);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
@ -81,7 +81,7 @@ pub async fn get_event_logs(
|
||||
|
||||
for stream_key in &srr.keys {
|
||||
for stream_id in &stream_key.ids {
|
||||
last_id = stream_id.id.clone();
|
||||
last_id.clone_from(&stream_id.id);
|
||||
for (k, v) in &stream_id.map {
|
||||
let res = handle_stream(&last_id, &channel, k, v).await;
|
||||
|
||||
|
@ -245,7 +245,7 @@ pub async fn get_frame_logs(
|
||||
|
||||
for stream_key in &srr.keys {
|
||||
for stream_id in &stream_key.ids {
|
||||
last_id = stream_id.id.clone();
|
||||
last_id.clone_from(&stream_id.id);
|
||||
for (k, v) in &stream_id.map {
|
||||
let res = handle_stream(&last_id, &channel, k, v).await;
|
||||
|
||||
|
@ -1106,7 +1106,7 @@ impl Data {
|
||||
trace!("Setting region_config_id to device-session");
|
||||
let d = self.device.as_mut().unwrap();
|
||||
let ds = d.get_device_session_mut()?;
|
||||
ds.region_config_id = self.uplink_frame_set.region_config_id.clone();
|
||||
ds.region_config_id.clone_from(&self.uplink_frame_set.region_config_id);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -576,7 +576,7 @@ impl JoinRequest {
|
||||
aes_key: v.aes_key.clone(),
|
||||
});
|
||||
}
|
||||
self.js_session_key_id = join_ans_pl.session_key_id.clone();
|
||||
self.js_session_key_id.clone_from(&join_ans_pl.session_key_id);
|
||||
|
||||
if let Some(v) = &join_ans_pl.nwk_s_key {
|
||||
let key = keywrap::unwrap(v).context("Unwrap nwk_s_key")?;
|
||||
|
Reference in New Issue
Block a user