Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added missing "moved" parameter to zc_init_logging_with_callback #685

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/zenoh_commons.h
Original file line number Diff line number Diff line change
Expand Up @@ -4701,7 +4701,7 @@ z_result_t zc_init_log_from_env_or(const char *fallback);
*/
ZENOHC_API
void zc_init_logging_with_callback(enum zc_log_severity_t min_severity,
struct zc_owned_closure_log_t *callback);
struct zc_moved_closure_log_t *callback);
/**
* Returns ``true`` if closure is valid, ``false`` if it is in gravestone state.
*/
Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use std::{cmp::min, slice};

use libc::c_void;
use transmute::TakeRustType;

use crate::transmute::LoanedCTypeRef;
#[macro_use]
Expand Down Expand Up @@ -116,10 +117,9 @@ pub unsafe extern "C" fn zc_init_log_from_env_or(
#[no_mangle]
pub extern "C" fn zc_init_logging_with_callback(
min_severity: zc_log_severity_t,
callback: &mut zc_owned_closure_log_t,
callback: &mut zc_moved_closure_log_t,
) {
let mut closure = zc_owned_closure_log_t::empty();
std::mem::swap(callback, &mut closure);
let closure = callback.take_rust_type();
zenoh_util::log::init_log_with_callback(
move |meta| min_severity <= (*meta.level()).into(),
move |record| {
Expand Down
Loading