Skip to content

Commit

Permalink
Fix cargo clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Mallets committed Mar 22, 2024
1 parent 7becb60 commit 5e30cef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/liveliness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ pub extern "C" fn zc_liveliness_declare_subscriber(
return z_owned_subscriber_t::null();
};
let callback = core::mem::replace(callback, z_owned_closure_sample_t::empty());
match session
let res = session
.liveliness()
.declare_subscriber(key)
.callback(move |sample| {
Expand All @@ -185,8 +185,8 @@ pub extern "C" fn zc_liveliness_declare_subscriber(
let sample = z_sample_t::new(&sample, &owner);
z_closure_sample_call(&callback, &sample)
})
.res()
{
.res();
match res {
Ok(token) => z_owned_subscriber_t::new(token),
Err(e) => {
log::error!("Failed to subscribe to liveliness: {e}");
Expand Down
6 changes: 3 additions & 3 deletions src/querying_subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ pub unsafe extern "C" fn ze_declare_querying_subscriber(
.query_timeout(std::time::Duration::from_millis(options.query_timeout_ms));
}
}
match sub
let res = sub
.callback(move |sample| {
let payload = sample.payload.contiguous();
let owner = match payload {
Expand All @@ -212,8 +212,8 @@ pub unsafe extern "C" fn ze_declare_querying_subscriber(
let sample = z_sample_t::new(&sample, &owner);
z_closure_sample_call(&closure, &sample)
})
.res()
{
.res();
match res {
Ok(sub) => ze_owned_querying_subscriber_t::new(sub, session),
Err(e) => {
log::debug!("{}", e);
Expand Down

0 comments on commit 5e30cef

Please sign in to comment.