diff --git a/native/chromium_jni_macro/src/utils/jni_utils.rs b/native/chromium_jni_macro/src/utils/jni_utils.rs index 77494aa..8d620a5 100644 --- a/native/chromium_jni_macro/src/utils/jni_utils.rs +++ b/native/chromium_jni_macro/src/utils/jni_utils.rs @@ -58,20 +58,20 @@ fn get_type_parameter(p: &Path) -> Punctuated { /// Extracts Args from an Option function pointer path Option<*mut fn(Args...)> pub fn extract_arguments(p: &Path) -> syn::punctuated::Punctuated { let bracket_args = get_type_parameter(p); - return match bracket_args.first().unwrap() { + match bracket_args.first().unwrap() { GenericArgument::Type(Type::BareFn(t)) => t.inputs.clone(), _ => panic!("Not a type"), - }; + } } /// Extracts the result type from an Option function pointer path Option<*mut fn(...) -> Result> pub fn extract_result(p: &Path) -> Option { let bracket_args = get_type_parameter(p); - return match bracket_args.first().unwrap() { + match bracket_args.first().unwrap() { GenericArgument::Type(Type::BareFn(t)) => match t.output.clone() { ReturnType::Type(_, ty) => Some(*ty), ReturnType::Default => None, }, _ => panic!("Not a type (result)"), - }; + } } diff --git a/native/chromium_jni_macro/src/utils/unzip4.rs b/native/chromium_jni_macro/src/utils/unzip4.rs index bc88f91..f6f8ade 100644 --- a/native/chromium_jni_macro/src/utils/unzip4.rs +++ b/native/chromium_jni_macro/src/utils/unzip4.rs @@ -6,7 +6,6 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v20.html */ - /// Trait for unzipping 4-tuples pub trait Unzip4 { fn unzip4(self) -> (FromA, FromB, FromC, FromD) diff --git a/native/chromium_jni_utils/src/lib.rs b/native/chromium_jni_utils/src/lib.rs index 96ee42a..a38043d 100644 --- a/native/chromium_jni_utils/src/lib.rs +++ b/native/chromium_jni_utils/src/lib.rs @@ -85,10 +85,10 @@ impl FromJavaValue for *mut T { impl FromJavaMember for usize { fn from_java_member(env: JNIEnv, object: JObject, name: &str) -> usize { // Read an integer field - return env + env .get_field(object, name, "I") .and_then(|v| v.i()) - .unwrap() as usize; + .unwrap() as usize } } diff --git a/native/chromium_subp/build.rs b/native/chromium_subp/build.rs index 57923fa..2a5e4f0 100644 --- a/native/chromium_subp/build.rs +++ b/native/chromium_subp/build.rs @@ -11,7 +11,6 @@ * Contributors: * Guillermo Zunino, Equo - initial implementation */ - fn main() { link(); } diff --git a/native/chromium_swt/src/cef_cookie.rs b/native/chromium_swt/src/cef_cookie.rs index 69b815e..e6432e6 100644 --- a/native/chromium_swt/src/cef_cookie.rs +++ b/native/chromium_swt/src/cef_cookie.rs @@ -20,10 +20,10 @@ pub extern "C" fn Java_org_eclipse_set_browser_lib_cefswt_1cookie_1visitor_1t_ce cookie: *mut chromium::cef::_cef_cookie_t, ) -> jstring { let value = unsafe { CStr::from_ptr(cefswt_cookie_value(cookie)) }; - return env + env .new_string(value.to_str().unwrap()) .unwrap() - .into_inner(); + .into_inner() } #[no_mangle] @@ -33,10 +33,10 @@ pub extern "C" fn Java_org_eclipse_set_browser_lib_cefswt_1cookie_1visitor_1t_ce cookie: *mut chromium::cef::_cef_cookie_t, ) -> jstring { let value = unsafe { CStr::from_ptr(cefswt_cookie_to_java(cookie)) }; - return env + env .new_string(value.to_str().unwrap()) .unwrap() - .into_inner(); + .into_inner() } fn cefswt_cookie_to_java(cookie: *mut chromium::cef::_cef_cookie_t) -> *mut c_char { diff --git a/native/chromium_swt/src/cef_download_item.rs b/native/chromium_swt/src/cef_download_item.rs index 6c4514d..61803fc 100644 --- a/native/chromium_swt/src/cef_download_item.rs +++ b/native/chromium_swt/src/cef_download_item.rs @@ -24,10 +24,10 @@ pub unsafe extern "C" fn get_full_path( let path = (*item).get_full_path.unwrap()(item); let value = CStr::from_ptr(crate::cefswt_cefstring_to_java(path)); - return env + env .new_string(value.to_str().unwrap()) .unwrap() - .into_inner(); + .into_inner() } #[jni_name("org.eclipse.set.browser.lib.cef_download_item_t")] @@ -56,10 +56,10 @@ pub unsafe extern "C" fn get_url( ) -> jstring { let url = (*item).get_url.unwrap()(item); let value = CStr::from_ptr(crate::cefswt_cefstring_to_java(url)); - return env + env .new_string(value.to_str().unwrap()) .unwrap() - .into_inner(); + .into_inner() } #[jni_name("org.eclipse.set.browser.lib.cef_download_item_t")]