diff --git a/zenoh-jni/src/scouting.rs b/zenoh-jni/src/scouting.rs index f399b4df1..356bfc5ab 100644 --- a/zenoh-jni/src/scouting.rs +++ b/zenoh-jni/src/scouting.rs @@ -29,19 +29,19 @@ use crate::{ }; /// Start a scout. -/// +/// /// # Params /// - `whatAmI`: Ordinal value of the WhatAmI enum. /// - `callback`: Callback to be executed whenever a hello message is received. /// - `config_string`: Optional embedded configuration as a string. /// - `format`: format of the `config_string` param. /// - `config_path`: Optional path to a config file. -/// +/// /// Note: Either the config_string or the config_path or None can be provided. /// If none is provided, then the default configuration is loaded. Otherwise /// it's the config_string or the config_path that are loaded. This consistency /// logic is granted by the kotlin layer. -/// +/// /// Returns a pointer to the scout, which must be freed afterwards. /// If starting the scout fails, an exception is thrown on the JVM, and a null pointer is returned. /// @@ -60,7 +60,6 @@ pub unsafe extern "C" fn Java_io_zenoh_jni_JNIScout_00024Companion_scoutViaJNI( let callback_global_ref = get_callback_global_ref(&mut env, callback)?; let java_vm = Arc::new(get_java_vm(&mut env)?); let whatAmIMatcher: WhatAmIMatcher = (whatAmI as u8).try_into().unwrap(); // The validity of the operation is guaranteed on the kotlin layer. - let config = if config_string.is_null() && config_path.is_null() { Config::default() } else if !config_string.is_null() { diff --git a/zenoh-jni/src/session.rs b/zenoh-jni/src/session.rs index afa5f40f1..fd38aed41 100644 --- a/zenoh-jni/src/session.rs +++ b/zenoh-jni/src/session.rs @@ -12,7 +12,7 @@ // ZettaScale Zenoh Team, // -use crate::errors::{Result}; +use crate::errors::Result; use crate::key_expr::process_kotlin_key_expr; use crate::{jni_error, utils::*}; use crate::{session_error, throw_exception}; diff --git a/zenoh-jni/src/utils.rs b/zenoh-jni/src/utils.rs index 7c7b5ff89..cee9794b9 100644 --- a/zenoh-jni/src/utils.rs +++ b/zenoh-jni/src/utils.rs @@ -14,10 +14,7 @@ use std::sync::Arc; -use crate::{ - errors::{Result}, - jni_error, session_error, throw_exception, -}; +use crate::{errors::Result, jni_error, session_error, throw_exception}; use jni::{ objects::{JByteArray, JObject, JString}, sys::jint,