mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-06-11 04:01:41 +00:00
Fix clippy warnings.
This commit is contained in:
parent
a0f56c0ff6
commit
f4478864ee
@ -110,13 +110,9 @@ pub fn pb_json_to_prost(obj: &pbjson_types::Struct) -> prost_types::Struct {
|
|||||||
|
|
||||||
fn _pb_json_to_prost(v: &pbjson_types::Value) -> prost_types::Value {
|
fn _pb_json_to_prost(v: &pbjson_types::Value) -> prost_types::Value {
|
||||||
prost_types::Value {
|
prost_types::Value {
|
||||||
kind: match &v.kind {
|
kind: v.kind.as_ref().map(|v| match v {
|
||||||
None => None,
|
|
||||||
Some(v) => Some(match v {
|
|
||||||
pbjson_types::value::Kind::NullValue(v) => prost_types::value::Kind::NullValue(*v),
|
pbjson_types::value::Kind::NullValue(v) => prost_types::value::Kind::NullValue(*v),
|
||||||
pbjson_types::value::Kind::NumberValue(v) => {
|
pbjson_types::value::Kind::NumberValue(v) => prost_types::value::Kind::NumberValue(*v),
|
||||||
prost_types::value::Kind::NumberValue(*v)
|
|
||||||
}
|
|
||||||
pbjson_types::value::Kind::StringValue(v) => {
|
pbjson_types::value::Kind::StringValue(v) => {
|
||||||
prost_types::value::Kind::StringValue(v.to_string())
|
prost_types::value::Kind::StringValue(v.to_string())
|
||||||
}
|
}
|
||||||
@ -132,10 +128,9 @@ fn _pb_json_to_prost(v: &pbjson_types::Value) -> prost_types::Value {
|
|||||||
}
|
}
|
||||||
pbjson_types::value::Kind::ListValue(v) => {
|
pbjson_types::value::Kind::ListValue(v) => {
|
||||||
prost_types::value::Kind::ListValue(prost_types::ListValue {
|
prost_types::value::Kind::ListValue(prost_types::ListValue {
|
||||||
values: v.values.iter().map(|i| _pb_json_to_prost(i)).collect(),
|
values: v.values.iter().map(_pb_json_to_prost).collect(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ impl<'a> Integration<'a> {
|
|||||||
info!("Starting MQTT consumer loop");
|
info!("Starting MQTT consumer loop");
|
||||||
while let Some(msg_opt) = stream.next().await {
|
while let Some(msg_opt) = stream.next().await {
|
||||||
if let Some(msg) = msg_opt {
|
if let Some(msg) = msg_opt {
|
||||||
let caps = match command_regex.captures(&msg.topic()) {
|
let caps = match command_regex.captures(msg.topic()) {
|
||||||
Some(v) => v,
|
Some(v) => v,
|
||||||
None => {
|
None => {
|
||||||
error!(topic = %msg.topic(), "Error parsing command topic (regex captures returned None)");
|
error!(topic = %msg.topic(), "Error parsing command topic (regex captures returned None)");
|
||||||
@ -398,7 +398,7 @@ async fn message_callback(
|
|||||||
match command.as_ref() {
|
match command.as_ref() {
|
||||||
"down" => {
|
"down" => {
|
||||||
let cmd: integration::DownlinkCommand = match json {
|
let cmd: integration::DownlinkCommand = match json {
|
||||||
true => serde_json::from_slice(&b)?,
|
true => serde_json::from_slice(b)?,
|
||||||
false => integration::DownlinkCommand::decode(&mut Cursor::new(b))?,
|
false => integration::DownlinkCommand::decode(&mut Cursor::new(b))?,
|
||||||
};
|
};
|
||||||
if dev_eui != cmd.dev_eui {
|
if dev_eui != cmd.dev_eui {
|
||||||
|
@ -10,6 +10,7 @@ use tracing::info;
|
|||||||
|
|
||||||
use crate::storage::{get_redis_conn, redis_key};
|
use crate::storage::{get_redis_conn, redis_key};
|
||||||
|
|
||||||
|
#[allow(clippy::upper_case_acronyms)]
|
||||||
#[allow(non_camel_case_types)]
|
#[allow(non_camel_case_types)]
|
||||||
#[derive(Deserialize, Serialize, Copy, Clone, Debug, Eq, PartialEq)]
|
#[derive(Deserialize, Serialize, Copy, Clone, Debug, Eq, PartialEq)]
|
||||||
pub enum Aggregation {
|
pub enum Aggregation {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user