mirror of
https://github.com/logos-messaging/logos-messaging-rust-bindings.git
synced 2026-01-11 02:13:05 +00:00
simple changes to make clippy happier
This commit is contained in:
parent
666bc73c04
commit
dd299001ce
@ -39,15 +39,13 @@ pub async fn waku_filter_subscribe(
|
||||
let code = unsafe {
|
||||
let mut closure = result_cb;
|
||||
let cb = get_trampoline(&closure);
|
||||
let out = waku_sys::waku_filter_subscribe(
|
||||
waku_sys::waku_filter_subscribe(
|
||||
ctx.get_ptr(),
|
||||
pubsub_topic_ptr,
|
||||
content_topics_ptr,
|
||||
cb,
|
||||
&mut closure as *mut _ as *mut c_void,
|
||||
);
|
||||
|
||||
out
|
||||
)
|
||||
};
|
||||
|
||||
notify.notified().await; // Wait until a result is received
|
||||
@ -79,15 +77,13 @@ pub async fn waku_filter_unsubscribe(
|
||||
let code = unsafe {
|
||||
let mut closure = result_cb;
|
||||
let cb = get_trampoline(&closure);
|
||||
let out = waku_sys::waku_filter_unsubscribe(
|
||||
waku_sys::waku_filter_unsubscribe(
|
||||
ctx.get_ptr(),
|
||||
pubsub_topic_ptr,
|
||||
content_topics_topics_ptr,
|
||||
cb,
|
||||
&mut closure as *mut _ as *mut c_void,
|
||||
);
|
||||
|
||||
out
|
||||
)
|
||||
};
|
||||
|
||||
notify.notified().await; // Wait until a result is received
|
||||
|
||||
@ -40,15 +40,13 @@ pub async fn waku_lightpush_publish_message(
|
||||
let code = unsafe {
|
||||
let mut closure = result_cb;
|
||||
let cb = get_trampoline(&closure);
|
||||
let out = waku_sys::waku_lightpush_publish(
|
||||
waku_sys::waku_lightpush_publish(
|
||||
ctx.get_ptr(),
|
||||
pubsub_topic_ptr,
|
||||
message_ptr,
|
||||
cb,
|
||||
&mut closure as *mut _ as *mut c_void,
|
||||
);
|
||||
|
||||
out
|
||||
)
|
||||
};
|
||||
|
||||
notify.notified().await; // Wait until a result is received
|
||||
|
||||
@ -36,9 +36,7 @@ pub async fn waku_new(config: Option<WakuNodeConfig>) -> Result<WakuNodeContext>
|
||||
let obj_ptr = unsafe {
|
||||
let mut closure = result_cb;
|
||||
let cb = get_trampoline(&closure);
|
||||
let out = waku_sys::waku_new(config_ptr, cb, &mut closure as *mut _ as *mut c_void);
|
||||
|
||||
out
|
||||
waku_sys::waku_new(config_ptr, cb, &mut closure as *mut _ as *mut c_void)
|
||||
};
|
||||
|
||||
notify.notified().await; // Wait until a result is received
|
||||
|
||||
@ -221,7 +221,7 @@ impl WakuNodeHandle<Running> {
|
||||
|
||||
messages.extend(response.messages);
|
||||
|
||||
if !response.pagination_cursor.is_some() {
|
||||
if response.pagination_cursor.is_none() {
|
||||
break;
|
||||
}
|
||||
cursor = response.pagination_cursor;
|
||||
@ -229,6 +229,6 @@ impl WakuNodeHandle<Running> {
|
||||
|
||||
messages.reverse();
|
||||
|
||||
return Ok(messages);
|
||||
Ok(messages)
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@ pub async fn waku_connect(
|
||||
let code = unsafe {
|
||||
let mut closure = result_cb;
|
||||
let cb = get_trampoline(&closure);
|
||||
let out = waku_sys::waku_connect(
|
||||
waku_sys::waku_connect(
|
||||
ctx.get_ptr(),
|
||||
address_ptr,
|
||||
timeout
|
||||
@ -47,9 +47,7 @@ pub async fn waku_connect(
|
||||
.unwrap_or(0),
|
||||
cb,
|
||||
&mut closure as *mut _ as *mut c_void,
|
||||
);
|
||||
|
||||
out
|
||||
)
|
||||
};
|
||||
|
||||
notify.notified().await; // Wait until a result is received
|
||||
|
||||
@ -46,7 +46,7 @@ pub async fn waku_create_content_topic(
|
||||
let code = unsafe {
|
||||
let mut closure = result_cb;
|
||||
let cb = get_trampoline(&closure);
|
||||
let out = waku_sys::waku_content_topic(
|
||||
waku_sys::waku_content_topic(
|
||||
ctx.get_ptr(),
|
||||
application_name_ptr,
|
||||
application_version,
|
||||
@ -54,9 +54,7 @@ pub async fn waku_create_content_topic(
|
||||
encoding_ptr,
|
||||
cb,
|
||||
&mut closure as *mut _ as *mut c_void,
|
||||
);
|
||||
|
||||
out
|
||||
)
|
||||
};
|
||||
|
||||
notify.notified().await; // Wait until a result is received
|
||||
@ -90,7 +88,7 @@ pub async fn waku_relay_publish_message(
|
||||
let code = unsafe {
|
||||
let mut closure = result_cb;
|
||||
let cb = get_trampoline(&closure);
|
||||
let out = waku_sys::waku_relay_publish(
|
||||
waku_sys::waku_relay_publish(
|
||||
ctx.get_ptr(),
|
||||
pubsub_topic.as_ptr(),
|
||||
message.as_ptr(),
|
||||
@ -104,9 +102,7 @@ pub async fn waku_relay_publish_message(
|
||||
.unwrap_or(0),
|
||||
cb,
|
||||
&mut closure as *mut _ as *mut c_void,
|
||||
);
|
||||
|
||||
out
|
||||
)
|
||||
};
|
||||
|
||||
notify.notified().await; // Wait until a result is received
|
||||
@ -128,14 +124,12 @@ pub async fn waku_relay_subscribe(ctx: &WakuNodeContext, pubsub_topic: &PubsubTo
|
||||
let code = unsafe {
|
||||
let mut closure = result_cb;
|
||||
let cb = get_trampoline(&closure);
|
||||
let out = waku_sys::waku_relay_subscribe(
|
||||
waku_sys::waku_relay_subscribe(
|
||||
ctx.get_ptr(),
|
||||
pubsub_topic_ptr,
|
||||
cb,
|
||||
&mut closure as *mut _ as *mut c_void,
|
||||
);
|
||||
|
||||
out
|
||||
)
|
||||
};
|
||||
|
||||
notify.notified().await; // Wait until a result is received
|
||||
@ -160,14 +154,12 @@ pub async fn waku_relay_unsubscribe(
|
||||
let code = unsafe {
|
||||
let mut closure = result_cb;
|
||||
let cb = get_trampoline(&closure);
|
||||
let out = waku_sys::waku_relay_subscribe(
|
||||
waku_sys::waku_relay_subscribe(
|
||||
ctx.get_ptr(),
|
||||
pubsub_topic_ptr,
|
||||
cb,
|
||||
&mut closure as *mut _ as *mut c_void,
|
||||
);
|
||||
|
||||
out
|
||||
)
|
||||
};
|
||||
|
||||
notify.notified().await; // Wait until a result is received
|
||||
|
||||
@ -130,16 +130,14 @@ pub async fn waku_store_query(
|
||||
let code = unsafe {
|
||||
let mut closure = result_cb;
|
||||
let cb = get_trampoline(&closure);
|
||||
let out = waku_sys::waku_store_query(
|
||||
waku_sys::waku_store_query(
|
||||
ctx.get_ptr(),
|
||||
json_query_ptr,
|
||||
peer_addr_ptr,
|
||||
timeout_millis,
|
||||
cb,
|
||||
&mut closure as *mut _ as *mut c_void,
|
||||
);
|
||||
|
||||
out
|
||||
)
|
||||
};
|
||||
|
||||
notify.notified().await; // Wait until a result is received
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user