Skip to content

Commit

Permalink
avoid clippy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivansete-status committed Dec 23, 2024
1 parent 863f208 commit 1052dca
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions waku-bindings/src/general/messagehash.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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
})
}
}

Expand Down
2 changes: 1 addition & 1 deletion waku-bindings/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
Expand Down
1 change: 1 addition & 0 deletions waku-bindings/src/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ impl WakuNodeHandle<Running> {
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<PubsubTopic>,
Expand Down

0 comments on commit 1052dca

Please sign in to comment.