Skip to content

Commit

Permalink
Cargo fmt + cargo clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
DariusIMP committed Sep 2, 2024
1 parent 72619a5 commit e95863a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions zenoh-jni/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand All @@ -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(
Expand All @@ -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(
Expand All @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion zenoh-jni/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ unsafe fn open_session(config_ptr: *const Config) -> Result<Session> {
.wait()
.map_err(|err| session_error!(err));
mem::forget(config);
return result;
result
}

/// Open a Zenoh session with a JSON configuration.
Expand Down

0 comments on commit e95863a

Please sign in to comment.