mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-04-09 04:14:22 +00:00
Fix clippy warnings.
This commit is contained in:
parent
7868629533
commit
ba7fc75ee6
@ -667,7 +667,8 @@ impl DeviceService for Device {
|
||||
kind: match v.kind {
|
||||
fields::MeasurementKind::COUNTER => common::MetricKind::Counter,
|
||||
fields::MeasurementKind::ABSOLUTE => common::MetricKind::Absolute,
|
||||
fields::MeasurementKind::GAUGE | _ => common::MetricKind::Gauge,
|
||||
fields::MeasurementKind::GAUGE => common::MetricKind::Gauge,
|
||||
_ => common::MetricKind::Gauge,
|
||||
}
|
||||
.into(),
|
||||
},
|
||||
|
@ -348,7 +348,7 @@ pub async fn get_frame_logs(
|
||||
if let Err(e) = res {
|
||||
// Return in case of channel error, in any other case we just log
|
||||
// the error.
|
||||
if let Some(_) = e.downcast_ref::<mpsc::error::SendError<api::LogItem>>() {
|
||||
if e.downcast_ref::<mpsc::error::SendError<api::LogItem>>().is_some() {
|
||||
return Err(e);
|
||||
}
|
||||
|
||||
|
@ -311,7 +311,7 @@ async fn message_callback(region_name: &str, region_common_name: CommonName, msg
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let json = payload_is_json(&b);
|
||||
let json = payload_is_json(b);
|
||||
|
||||
info!(
|
||||
region_name = region_name,
|
||||
@ -328,7 +328,7 @@ async fn message_callback(region_name: &str, region_common_name: CommonName, msg
|
||||
})
|
||||
.inc();
|
||||
let mut event = match json {
|
||||
true => serde_json::from_slice(&b)?,
|
||||
true => serde_json::from_slice(b)?,
|
||||
false => chirpstack_api::gw::UplinkFrame::decode(&mut Cursor::new(b))?,
|
||||
};
|
||||
event.v4_migrate();
|
||||
@ -347,7 +347,7 @@ async fn message_callback(region_name: &str, region_common_name: CommonName, msg
|
||||
})
|
||||
.inc();
|
||||
let mut event = match json {
|
||||
true => serde_json::from_slice(&b)?,
|
||||
true => serde_json::from_slice(b)?,
|
||||
false => chirpstack_api::gw::GatewayStats::decode(&mut Cursor::new(b))?,
|
||||
};
|
||||
event.v4_migrate();
|
||||
@ -367,7 +367,7 @@ async fn message_callback(region_name: &str, region_common_name: CommonName, msg
|
||||
})
|
||||
.inc();
|
||||
let mut event = match json {
|
||||
true => serde_json::from_slice(&b)?,
|
||||
true => serde_json::from_slice(b)?,
|
||||
false => chirpstack_api::gw::DownlinkTxAck::decode(&mut Cursor::new(b))?,
|
||||
};
|
||||
event.v4_migrate();
|
||||
|
Loading…
x
Reference in New Issue
Block a user