Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
DariusIMP committed Aug 29, 2024
1 parent 50282e2 commit 40c5e17
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
7 changes: 3 additions & 4 deletions zenoh-jni/src/scouting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand All @@ -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() {
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 @@ -12,7 +12,7 @@
// ZettaScale Zenoh Team, <[email protected]>
//

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};
Expand Down
5 changes: 1 addition & 4 deletions zenoh-jni/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 40c5e17

Please sign in to comment.