mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-01-19 02:56:23 +00:00
Fix clippy warnings & errors after Rust update.
This commit is contained in:
parent
b4845b5613
commit
a9e1f02f0f
@ -174,7 +174,7 @@ impl JoinAccept<'_> {
|
|||||||
.gateway_tenant_id_map
|
.gateway_tenant_id_map
|
||||||
.get(&gw_id)
|
.get(&gw_id)
|
||||||
.map(|v| v.into_bytes().to_vec())
|
.map(|v| v.into_bytes().to_vec())
|
||||||
.unwrap_or_else(Vec::new),
|
.unwrap_or_default(),
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
|
@ -92,7 +92,7 @@ impl PassiveRoamingDownlink {
|
|||||||
.gateway_tenant_id_map
|
.gateway_tenant_id_map
|
||||||
.get(&gw_id)
|
.get(&gw_id)
|
||||||
.map(|v| v.into_bytes().to_vec())
|
.map(|v| v.into_bytes().to_vec())
|
||||||
.unwrap_or_else(Vec::new),
|
.unwrap_or_default(),
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
|
@ -667,7 +667,7 @@ impl TxAck {
|
|||||||
let mut plaintext_frm_payload = false;
|
let mut plaintext_frm_payload = false;
|
||||||
if let Payload::MACPayload(pl) = &phy.payload {
|
if let Payload::MACPayload(pl) = &phy.payload {
|
||||||
// f_port must be either 0 or 226 (Relay).
|
// f_port must be either 0 or 226 (Relay).
|
||||||
if vec![0, lrwn::LA_FPORT_RELAY].contains(&pl.f_port.unwrap_or(0)) {
|
if [0, lrwn::LA_FPORT_RELAY].contains(&pl.f_port.unwrap_or(0)) {
|
||||||
phy.decrypt_frm_payload(&nwk_s_enc_key)?;
|
phy.decrypt_frm_payload(&nwk_s_enc_key)?;
|
||||||
plaintext_frm_payload = true;
|
plaintext_frm_payload = true;
|
||||||
}
|
}
|
||||||
|
@ -145,9 +145,9 @@ impl<'a> Integration<'a> {
|
|||||||
command_regex: Regex::new(&templates.render(
|
command_regex: Regex::new(&templates.render(
|
||||||
"command_topic",
|
"command_topic",
|
||||||
&CommandTopicContext {
|
&CommandTopicContext {
|
||||||
application_id: r#"(?P<application_id>[\w-]+)"#.to_string(),
|
application_id: r"(?P<application_id>[\w-]+)".to_string(),
|
||||||
dev_eui: r#"(?P<dev_eui>[\w]+)"#.to_string(),
|
dev_eui: r"(?P<dev_eui>[\w]+)".to_string(),
|
||||||
command: r#"(?P<command>[\w]+)"#.to_string(),
|
command: r"(?P<command>[\w]+)".to_string(),
|
||||||
},
|
},
|
||||||
)?)?,
|
)?)?,
|
||||||
qos: conf.qos,
|
qos: conf.qos,
|
||||||
|
@ -311,7 +311,6 @@ pub async fn get_for_phypayload(
|
|||||||
|
|
||||||
async fn get_dev_euis_for_dev_addr(dev_addr: DevAddr) -> Result<Vec<EUI64>> {
|
async fn get_dev_euis_for_dev_addr(dev_addr: DevAddr) -> Result<Vec<EUI64>> {
|
||||||
task::spawn_blocking({
|
task::spawn_blocking({
|
||||||
let dev_addr = dev_addr;
|
|
||||||
move || -> Result<Vec<EUI64>> {
|
move || -> Result<Vec<EUI64>> {
|
||||||
let key = redis_key(format!("devaddr:{{{}}}", dev_addr));
|
let key = redis_key(format!("devaddr:{{{}}}", dev_addr));
|
||||||
let mut c = get_redis_conn()?;
|
let mut c = get_redis_conn()?;
|
||||||
@ -333,8 +332,6 @@ async fn get_dev_euis_for_dev_addr(dev_addr: DevAddr) -> Result<Vec<EUI64>> {
|
|||||||
|
|
||||||
async fn remove_dev_eui_from_dev_addr_set(dev_addr: DevAddr, dev_eui: EUI64) -> Result<()> {
|
async fn remove_dev_eui_from_dev_addr_set(dev_addr: DevAddr, dev_eui: EUI64) -> Result<()> {
|
||||||
task::spawn_blocking({
|
task::spawn_blocking({
|
||||||
let dev_addr = dev_addr;
|
|
||||||
let dev_eui = dev_eui;
|
|
||||||
move || -> Result<()> {
|
move || -> Result<()> {
|
||||||
let key = redis_key(format!("devaddr:{{{}}}", dev_addr));
|
let key = redis_key(format!("devaddr:{{{}}}", dev_addr));
|
||||||
let mut c = get_redis_conn()?;
|
let mut c = get_redis_conn()?;
|
||||||
|
@ -458,7 +458,7 @@ impl Data {
|
|||||||
.gateway_tenant_id_map
|
.gateway_tenant_id_map
|
||||||
.get(&gw_id)
|
.get(&gw_id)
|
||||||
.map(|v| v.into_bytes().to_vec())
|
.map(|v| v.into_bytes().to_vec())
|
||||||
.unwrap_or_else(Vec::new),
|
.unwrap_or_default(),
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
|
@ -253,7 +253,7 @@ impl JoinRequest {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if !self.device_keys.is_some() {
|
if self.device_keys.is_none() {
|
||||||
trace!(join_eui = %jr.join_eui, "Getting Join Server client");
|
trace!(join_eui = %jr.join_eui, "Getting Join Server client");
|
||||||
self.js_client = Some(joinserver::get(&jr.join_eui)?);
|
self.js_client = Some(joinserver::get(&jr.join_eui)?);
|
||||||
}
|
}
|
||||||
|
@ -145,7 +145,7 @@ impl JoinRequest {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if !self.device_keys.is_some() {
|
if self.device_keys.is_none() {
|
||||||
trace!(join_eui = %jr.join_eui, "Getting Join Server client");
|
trace!(join_eui = %jr.join_eui, "Getting Join Server client");
|
||||||
self.js_client = Some(joinserver::get(&jr.join_eui)?);
|
self.js_client = Some(joinserver::get(&jr.join_eui)?);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user