diff --git a/zenoh-jni/src/config.rs b/zenoh-jni/src/config.rs index ec0c5002f..0edf1420e 100644 --- a/zenoh-jni/src/config.rs +++ b/zenoh-jni/src/config.rs @@ -24,10 +24,10 @@ use crate::errors::Result; use crate::{session_error, throw_exception, utils::decode_string}; /// Loads the default configuration, returning a raw pointer to it. -/// +/// /// The pointer to the config is expected to be freed later on upon the destruction of the /// Kotlin Config instance. -/// +/// #[no_mangle] #[allow(non_snake_case)] pub extern "C" fn Java_io_zenoh_jni_JNIConfig_00024Companion_loadDefaultConfigViaJNI( @@ -40,10 +40,10 @@ pub extern "C" fn Java_io_zenoh_jni_JNIConfig_00024Companion_loadDefaultConfigVi /// Loads the config from a file, returning a pointer to the loaded config in case of success. /// In case of failure, an exception is thrown via JNI. -/// +/// /// The pointer to the config is expected to be freed later on upon the destruction of the /// Kotlin Config instance. -/// +/// #[no_mangle] #[allow(non_snake_case)] pub extern "C" fn Java_io_zenoh_jni_JNIConfig_00024Companion_loadConfigFileViaJNI( @@ -64,10 +64,10 @@ pub extern "C" fn Java_io_zenoh_jni_JNIConfig_00024Companion_loadConfigFileViaJN /// Loads the config from a json/json5 formatted string, returning a pointer to the loaded config /// in case of success. In case of failure, an exception is thrown via JNI. -/// +/// /// The pointer to the config is expected to be freed later on upon the destruction of the /// Kotlin Config instance. -/// +/// #[no_mangle] #[allow(non_snake_case)] pub extern "C" fn Java_io_zenoh_jni_JNIConfig_00024Companion_loadJsonConfigViaJNI( @@ -93,10 +93,10 @@ pub extern "C" fn Java_io_zenoh_jni_JNIConfig_00024Companion_loadJsonConfigViaJN /// Loads the config from a yaml-formatted string, returning a pointer to the loaded config /// in case of success. In case of failure, an exception is thrown via JNI. -/// +/// /// The pointer to the config is expected to be freed later on upon the destruction of the /// Kotlin Config instance. -/// +/// #[no_mangle] #[allow(non_snake_case)] pub extern "C" fn Java_io_zenoh_jni_JNIConfig_00024Companion_loadYamlConfigViaJNI( @@ -119,7 +119,7 @@ pub extern "C" fn Java_io_zenoh_jni_JNIConfig_00024Companion_loadYamlConfigViaJN }) } -/// Frees the pointer to the config. The pointer should be valid and should have been obtained through +/// Frees the pointer to the config. The pointer should be valid and should have been obtained through /// one of the preceding `load` functions. This function should be called upon destruction of the kotlin /// Config instance. #[no_mangle] diff --git a/zenoh-jni/src/session.rs b/zenoh-jni/src/session.rs index a0be09de7..dcc8a47dc 100644 --- a/zenoh-jni/src/session.rs +++ b/zenoh-jni/src/session.rs @@ -75,7 +75,7 @@ unsafe fn open_session(config_ptr: *const Config) -> Result { .wait() .map_err(|err| session_error!(err)); mem::forget(config); - return result; + result } /// Open a Zenoh session with a JSON configuration.