diff --git a/api/rust/build.rs b/api/rust/build.rs index 303b690e..08691754 100644 --- a/api/rust/build.rs +++ b/api/rust/build.rs @@ -82,11 +82,6 @@ fn main() -> Result<(), Box> { .extern_path(".google.protobuf", well_known_types_path) .extern_path(".common", "crate::common"); - #[cfg(feature = "diesel")] - { - builder = builder.message_attribute("internal.DeviceSession", "#[derive(diesel::expression::AsExpression, diesel::deserialize::FromSqlRow)] #[diesel(sql_type = diesel::sql_types::Binary)]"); - } - builder.compile_protos( &[cs_dir .join("internal") diff --git a/chirpstack/src/adr/plugin.rs b/chirpstack/src/adr/plugin.rs index f2f1481c..f6379d8b 100644 --- a/chirpstack/src/adr/plugin.rs +++ b/chirpstack/src/adr/plugin.rs @@ -21,7 +21,7 @@ impl Plugin { let m = rquickjs::Module::declare(ctx, "script", script.clone()) .context("Declare script")?; let (m, m_promise) = m.eval().context("Evaluate script")?; - m_promise.finish()?; + () = m_promise.finish()?; let id_func: rquickjs::Function = m.get("id").context("Get id function")?; let name_func: rquickjs::Function = m.get("name").context("Get name function")?; @@ -55,7 +55,7 @@ impl Handler for Plugin { let m = rquickjs::Module::declare(ctx.clone(), "script", self.script.clone()) .context("Declare script")?; let (m, m_promise) = m.eval().context("Evaluate script")?; - m_promise.finish()?; + () = m_promise.finish()?; let func: rquickjs::Function = m.get("handle").context("Get handle function")?; let device_variables = rquickjs::Object::new(ctx.clone())?; diff --git a/chirpstack/src/api/backend/mod.rs b/chirpstack/src/api/backend/mod.rs index b76dece8..62adc178 100644 --- a/chirpstack/src/api/backend/mod.rs +++ b/chirpstack/src/api/backend/mod.rs @@ -601,7 +601,7 @@ async fn handle_async_ans(bp: &BasePayload, b: &[u8]) -> Result { let key = redis_key(format!("backend:async:{}", transaction_id)); - redis::pipe() + () = redis::pipe() .atomic() .cmd("XADD") .arg(&key) diff --git a/chirpstack/src/api/oauth2.rs b/chirpstack/src/api/oauth2.rs index 462a37f1..38394f35 100644 --- a/chirpstack/src/api/oauth2.rs +++ b/chirpstack/src/api/oauth2.rs @@ -162,7 +162,7 @@ async fn store_verifier( trace!("Storing verifier"); let key = redis_key(format!("auth:oauth2:{}", token.secret())); - redis::cmd("PSETEX") + () = redis::cmd("PSETEX") .arg(key) .arg(Duration::try_minutes(5).unwrap().num_milliseconds()) .arg(verifier.secret()) diff --git a/chirpstack/src/api/oidc.rs b/chirpstack/src/api/oidc.rs index 9424edfc..5ce8c82d 100644 --- a/chirpstack/src/api/oidc.rs +++ b/chirpstack/src/api/oidc.rs @@ -119,7 +119,7 @@ async fn store_nonce(state: &CsrfToken, nonce: &Nonce) -> Result<()> { trace!("Storing nonce"); let key = redis_key(format!("auth:oidc:{}", state.secret())); - redis::cmd("PSETEX") + () = redis::cmd("PSETEX") .arg(key) .arg(Duration::try_minutes(5).unwrap().num_milliseconds()) .arg(nonce.secret()) diff --git a/chirpstack/src/codec/js/mod.rs b/chirpstack/src/codec/js/mod.rs index 54d71028..708e2608 100644 --- a/chirpstack/src/codec/js/mod.rs +++ b/chirpstack/src/codec/js/mod.rs @@ -63,7 +63,7 @@ pub async fn decode( .eval() .catch(&ctx) .map_err(|e| anyhow!("JS error: {}", e))?; - buff_promise.finish()?; + () = buff_promise.finish()?; let buff: rquickjs::Function = buff.get("Buffer")?; let input = rquickjs::Object::new(ctx.clone())?; @@ -154,7 +154,7 @@ pub async fn encode( .eval() .catch(&ctx) .map_err(|e| anyhow!("JS error: {}", e))?; - buff_promise.finish()?; + () = buff_promise.finish()?; let buff: rquickjs::Function = buff.get("Buffer")?; let input = rquickjs::Object::new(ctx.clone())?; diff --git a/chirpstack/src/integration/kafka.rs b/chirpstack/src/integration/kafka.rs index 1c2e7b78..6865cc3b 100644 --- a/chirpstack/src/integration/kafka.rs +++ b/chirpstack/src/integration/kafka.rs @@ -39,7 +39,7 @@ impl<'a> Integration<'a> { templates.register_template_string("event_key", &conf.event_key)?; let producer: FutureProducer = ClientConfig::new() - .set("bootstrap.servers", &conf.brokers.join(",")) + .set("bootstrap.servers", conf.brokers.join(",")) .set("message.timeout.ms", "5000") .set("allow.auto.create.topics", "true") .set( diff --git a/chirpstack/src/integration/loracloud/buffer.rs b/chirpstack/src/integration/loracloud/buffer.rs index 6d205a99..a4569905 100644 --- a/chirpstack/src/integration/loracloud/buffer.rs +++ b/chirpstack/src/integration/loracloud/buffer.rs @@ -86,7 +86,7 @@ pub async fn save_geoloc_buffer( }; let b = buffer.encode_to_vec(); - redis::cmd("PSETEX") + () = redis::cmd("PSETEX") .arg(key) .arg(ttl.num_milliseconds()) .arg(b) diff --git a/chirpstack/src/storage/device_gateway.rs b/chirpstack/src/storage/device_gateway.rs index 957dbbfc..8579f070 100644 --- a/chirpstack/src/storage/device_gateway.rs +++ b/chirpstack/src/storage/device_gateway.rs @@ -16,7 +16,7 @@ pub async fn save_rx_info(rx_info: &internal::DeviceGatewayRxInfo) -> Result<()> let ttl = conf.network.device_session_ttl.as_millis() as usize; let b = rx_info.encode_to_vec(); - redis::cmd("PSETEX") + () = redis::cmd("PSETEX") .arg(key) .arg(ttl) .arg(b) diff --git a/chirpstack/src/storage/downlink_frame.rs b/chirpstack/src/storage/downlink_frame.rs index 4cfa5f5d..7f312281 100644 --- a/chirpstack/src/storage/downlink_frame.rs +++ b/chirpstack/src/storage/downlink_frame.rs @@ -11,7 +11,7 @@ pub async fn save(df: &internal::DownlinkFrame) -> Result<()> { let b = df.encode_to_vec(); let key = redis_key(format!("frame:{}", df.downlink_id)); - redis::cmd("SETEX") + () = redis::cmd("SETEX") .arg(key) .arg(30) .arg(b) diff --git a/chirpstack/src/storage/mac_command.rs b/chirpstack/src/storage/mac_command.rs index c9aa3dbb..f248e719 100644 --- a/chirpstack/src/storage/mac_command.rs +++ b/chirpstack/src/storage/mac_command.rs @@ -12,7 +12,7 @@ pub async fn set_pending(dev_eui: &EUI64, cid: lrwn::CID, set: &lrwn::MACCommand let ttl = conf.network.device_session_ttl.as_millis() as usize; let b = set.to_vec()?; - redis::cmd("PSETEX") + () = redis::cmd("PSETEX") .arg(key) .arg(ttl) .arg(b) @@ -48,7 +48,7 @@ pub async fn get_pending(dev_eui: &EUI64, cid: lrwn::CID) -> Result Result<()> { let key = redis_key(format!("device:{}:mac:pending:{}", dev_eui, cid.to_u8())); - redis::cmd("DEL") + () = redis::cmd("DEL") .arg(key) .query_async(&mut get_async_redis_conn().await?) .await?; diff --git a/chirpstack/src/storage/metrics.rs b/chirpstack/src/storage/metrics.rs index 1b4e421b..7fe0624d 100644 --- a/chirpstack/src/storage/metrics.rs +++ b/chirpstack/src/storage/metrics.rs @@ -78,7 +78,7 @@ pub async fn save_state(name: &str, state: &str) -> Result<()> { let key = redis_key(format!("metrics:{{{}}}", name)); let ttl = get_ttl(Aggregation::MONTH); - redis::cmd("PSETEX") + () = redis::cmd("PSETEX") .arg(key) .arg(ttl.as_millis() as usize) .arg(state) @@ -160,7 +160,7 @@ pub async fn save(name: &str, record: &Record, aggregations: &[Aggregation]) -> info!(name = %name, aggregation = %a, "Metrics saved"); } - pipe.query_async(&mut get_async_redis_conn().await?).await?; + () = pipe.query_async(&mut get_async_redis_conn().await?).await?; Ok(()) } diff --git a/chirpstack/src/storage/mod.rs b/chirpstack/src/storage/mod.rs index 7468fc3b..721418e4 100644 --- a/chirpstack/src/storage/mod.rs +++ b/chirpstack/src/storage/mod.rs @@ -226,7 +226,7 @@ pub async fn reset_db() -> Result<()> { #[cfg(test)] pub async fn reset_redis() -> Result<()> { - redis::cmd("FLUSHDB") + () = redis::cmd("FLUSHDB") .query_async(&mut get_async_redis_conn().await?) .await?; Ok(()) diff --git a/chirpstack/src/storage/passive_roaming.rs b/chirpstack/src/storage/passive_roaming.rs index ee3c2aaf..d4cadf05 100644 --- a/chirpstack/src/storage/passive_roaming.rs +++ b/chirpstack/src/storage/passive_roaming.rs @@ -55,15 +55,15 @@ pub async fn save(ds: &internal::PassiveRoamingDeviceSession) -> Result<()> { // * We need to be able to lookup the session using the DevAddr (potentially // using the MIC validation). // * We need to be able to stop a passive-roaming session given a DevEUI. - redis::pipe() + () = redis::pipe() .atomic() .cmd("SADD") .arg(&dev_addr_key) - .arg(&sess_id.to_string()) + .arg(sess_id.to_string()) .ignore() .cmd("SADD") .arg(&dev_eui_key) - .arg(&sess_id.to_string()) + .arg(sess_id.to_string()) .ignore() .cmd("PEXPIRE") .arg(&dev_addr_key) @@ -105,7 +105,7 @@ pub async fn get(id: Uuid) -> Result Result<()> { let key = redis_key(format!("pr:sess:{{{}}}", id)); - redis::cmd("DEL") + () = redis::cmd("DEL") .arg(&key) .query_async(&mut get_async_redis_conn().await?) .await?; diff --git a/chirpstack/src/stream/api_request.rs b/chirpstack/src/stream/api_request.rs index fa73dab2..0ef58474 100644 --- a/chirpstack/src/stream/api_request.rs +++ b/chirpstack/src/stream/api_request.rs @@ -14,7 +14,7 @@ pub async fn log_request(pl: &stream::ApiRequestLog) -> Result<()> { let key = redis_key("api:stream:request".to_string()); let b = pl.encode_to_vec(); - redis::cmd("XADD") + () = redis::cmd("XADD") .arg(&key) .arg("MAXLEN") .arg(conf.monitoring.api_request_log_max_history) diff --git a/chirpstack/src/stream/backend_interfaces.rs b/chirpstack/src/stream/backend_interfaces.rs index fbec09a1..a489bb9b 100644 --- a/chirpstack/src/stream/backend_interfaces.rs +++ b/chirpstack/src/stream/backend_interfaces.rs @@ -37,7 +37,7 @@ pub async fn log_request(pl: stream::BackendInterfacesRequest) -> Result<()> { let key = redis_key("backend_interfaces:stream:request".to_string()); let b = pl.encode_to_vec(); - redis::cmd("XADD") + () = redis::cmd("XADD") .arg(&key) .arg("MAXLEN") .arg(conf.monitoring.backend_interfaces_log_max_history) diff --git a/chirpstack/src/stream/event.rs b/chirpstack/src/stream/event.rs index ff35e358..e109d468 100644 --- a/chirpstack/src/stream/event.rs +++ b/chirpstack/src/stream/event.rs @@ -21,7 +21,7 @@ pub async fn log_event_for_device(typ: &str, dev_eui: &str, b: &[u8]) -> Result< // per device stream if conf.monitoring.per_device_event_log_max_history > 0 { let key = redis_key(format!("device:{{{}}}:stream:event", dev_eui)); - redis::pipe() + () = redis::pipe() .atomic() .cmd("XADD") .arg(&key) @@ -42,7 +42,7 @@ pub async fn log_event_for_device(typ: &str, dev_eui: &str, b: &[u8]) -> Result< // global device stream if conf.monitoring.device_event_log_max_history > 0 { let key = redis_key("device:stream:event".to_string()); - redis::cmd("XADD") + () = redis::cmd("XADD") .arg(&key) .arg("MAXLEN") .arg(conf.monitoring.device_event_log_max_history) diff --git a/chirpstack/src/stream/frame.rs b/chirpstack/src/stream/frame.rs index 05fa828a..e5ad7be9 100644 --- a/chirpstack/src/stream/frame.rs +++ b/chirpstack/src/stream/frame.rs @@ -41,7 +41,7 @@ pub async fn log_uplink_for_gateways(ufl: &stream::UplinkFrameLog) -> Result<()> if conf.monitoring.per_gateway_frame_log_max_history > 0 { let key = redis_key(format!("gw:{{{}}}:stream:frame", gateway_id)); - redis::pipe() + () = redis::pipe() .atomic() .cmd("XADD") .arg(&key) @@ -62,7 +62,7 @@ pub async fn log_uplink_for_gateways(ufl: &stream::UplinkFrameLog) -> Result<()> // global gateway stream if conf.monitoring.gateway_frame_log_max_history > 0 { let key = redis_key("gw:stream:frame".to_string()); - redis::cmd("XADD") + () = redis::cmd("XADD") .arg(&key) .arg("MAXLEN") .arg(conf.monitoring.gateway_frame_log_max_history) @@ -89,7 +89,7 @@ pub async fn log_downlink_for_gateway(dfl: &stream::DownlinkFrameLog) -> Result< // per gateway stream if conf.monitoring.per_gateway_frame_log_max_history > 0 { let key = redis_key(format!("gw:{{{}}}:stream:frame", dfl.gateway_id)); - redis::pipe() + () = redis::pipe() .atomic() .cmd("XADD") .arg(&key) @@ -110,7 +110,7 @@ pub async fn log_downlink_for_gateway(dfl: &stream::DownlinkFrameLog) -> Result< // global gateway stream if conf.monitoring.gateway_frame_log_max_history > 0 { let key = redis_key("gw:stream:frame".to_string()); - redis::cmd("XADD") + () = redis::cmd("XADD") .arg(&key) .arg("MAXLEN") .arg(conf.monitoring.gateway_frame_log_max_history) @@ -137,7 +137,7 @@ pub async fn log_uplink_for_device(ufl: &stream::UplinkFrameLog) -> Result<()> { if conf.monitoring.per_device_frame_log_max_history > 0 { let key = redis_key(format!("device:{{{}}}:stream:frame", ufl.dev_eui)); - redis::pipe() + () = redis::pipe() .atomic() .cmd("XADD") .arg(&key) @@ -158,7 +158,7 @@ pub async fn log_uplink_for_device(ufl: &stream::UplinkFrameLog) -> Result<()> { // global device stream if conf.monitoring.device_frame_log_max_history > 0 { let key = redis_key("device:stream:frame".to_string()); - redis::cmd("XADD") + () = redis::cmd("XADD") .arg(&key) .arg("MAXLEN") .arg(conf.monitoring.device_frame_log_max_history) @@ -185,7 +185,7 @@ pub async fn log_downlink_for_device(dfl: &stream::DownlinkFrameLog) -> Result<( if conf.monitoring.per_device_frame_log_max_history > 0 { let key = redis_key(format!("device:{{{}}}:stream:frame", dfl.dev_eui)); - redis::pipe() + () = redis::pipe() .atomic() .cmd("XADD") .arg(&key) @@ -206,7 +206,7 @@ pub async fn log_downlink_for_device(dfl: &stream::DownlinkFrameLog) -> Result<( // global device stream if conf.monitoring.device_frame_log_max_history > 0 { let key = redis_key("device:stream:frame".to_string()); - redis::cmd("XADD") + () = redis::cmd("XADD") .arg(&key) .arg("MAXLEN") .arg(conf.monitoring.device_frame_log_max_history) diff --git a/chirpstack/src/stream/meta.rs b/chirpstack/src/stream/meta.rs index bf2aba92..85ab2a27 100644 --- a/chirpstack/src/stream/meta.rs +++ b/chirpstack/src/stream/meta.rs @@ -11,7 +11,7 @@ pub async fn log_uplink(up: &stream::UplinkMeta) -> Result<()> { if conf.monitoring.meta_log_max_history > 0 { let key = redis_key("stream:meta".to_string()); let b = up.encode_to_vec(); - redis::cmd("XADD") + () = redis::cmd("XADD") .arg(&key) .arg("MAXLEN") .arg(conf.monitoring.meta_log_max_history) @@ -32,7 +32,7 @@ pub async fn log_downlink(down: &stream::DownlinkMeta) -> Result<()> { let key = redis_key("stream:meta".to_string()); let b = down.encode_to_vec(); - redis::cmd("XADD") + () = redis::cmd("XADD") .arg(&key) .arg("MAXLEN") .arg(conf.monitoring.meta_log_max_history) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 4712a8ed..e1112795 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] - channel = "1.79.0" + channel = "1.81.0" components = ["rustfmt", "clippy"] profile = "default"