diff --git a/waku-bindings/src/general/messagehash.rs b/waku-bindings/src/general/messagehash.rs index a3dce99..d91c40e 100644 --- a/waku-bindings/src/general/messagehash.rs +++ b/waku-bindings/src/general/messagehash.rs @@ -1,4 +1,5 @@ use crate::general::waku_decode::WakuDecode; +use std::fmt::Write; use hex::FromHex; use serde::{Deserialize, Deserializer, Serialize}; use std::convert::TryInto; @@ -12,8 +13,10 @@ pub struct MessageHash([u8; 32]); impl MessageHash { fn to_hex_string(&self) -> String { - let hex: String = self.0.iter().map(|b| format!("{:02x}", b)).collect(); - format!("0x{}", hex) + self.0.iter().fold(String::new(), |mut output, b| { + let _ = write!(output, "{b:02X}"); + output + }) } } diff --git a/waku-bindings/src/macros.rs b/waku-bindings/src/macros.rs index b1440d6..4959638 100644 --- a/waku-bindings/src/macros.rs +++ b/waku-bindings/src/macros.rs @@ -37,7 +37,7 @@ where macro_rules! handle_ffi_call { // Case: With or without additional arguments ($waku_fn:expr, $resp_hndlr:expr, $ctx:expr $(, $($arg:expr),*)?) => {{ - use crate::macros::get_trampoline; + use $crate::macros::get_trampoline; use std::sync::Arc; use tokio::sync::Notify; use libc::*; diff --git a/waku-bindings/src/node/mod.rs b/waku-bindings/src/node/mod.rs index d6c8cbc..27d0fbf 100644 --- a/waku-bindings/src/node/mod.rs +++ b/waku-bindings/src/node/mod.rs @@ -170,6 +170,7 @@ impl WakuNodeHandle { lightpush::waku_lightpush_publish_message(&self.ctx, message, pubsub_topic).await } + #[allow(clippy::too_many_arguments)] pub async fn store_query( &self, pubsub_topic: Option,