diff --git a/components/fonts/platform/freetype/ohos/font_list.rs b/components/fonts/platform/freetype/ohos/font_list.rs index 13b703a28a6..e35bce5b226 100644 --- a/components/fonts/platform/freetype/ohos/font_list.rs +++ b/components/fonts/platform/freetype/ohos/font_list.rs @@ -307,7 +307,7 @@ impl FontList { fn detect_installed_font_families() -> Vec { let mut families = enumerate_font_files() .inspect_err(|e| error!("Failed to enumerate font files due to `{e:?}`")) - .map(|font_files| parse_font_filenames(font_files)) + .map(parse_font_filenames) .unwrap_or_else(|_| FontList::fallback_font_families()); families.extend(Self::hardcoded_font_families()); families diff --git a/ports/servoshell/egl/ohos.rs b/ports/servoshell/egl/ohos.rs index e02dd91d1b0..7c70aa8254f 100644 --- a/ports/servoshell/egl/ohos.rs +++ b/ports/servoshell/egl/ohos.rs @@ -173,7 +173,7 @@ impl ServoAction { x, y, pointer_id, - } => Self::dispatch_touch_event(&servo, *kind, *x, *y, *pointer_id), + } => Self::dispatch_touch_event(servo, *kind, *x, *y, *pointer_id), KeyUp(k) => servo.key_up(k.clone()), KeyDown(k) => servo.key_down(k.clone()), InsertText(text) => servo.ime_insert_text(text.clone()), @@ -205,7 +205,7 @@ impl ServoAction { if let Some(native_webview_components) = NATIVE_WEBVIEWS.lock().unwrap().get(*arkts_id as usize) { - if (servo.active_webview().id() != native_webview_components.id) { + if servo.active_webview().id() != native_webview_components.id { servo.focus_webview(native_webview_components.id); servo.pause_compositor(); let (window_handle, _, coordinates) = simpleservo::get_raw_window_handle( @@ -239,7 +239,7 @@ impl ServoAction { .lock() .unwrap() .push(NativeWebViewComponents { - id: id, + id, xcomponent: xcomponent.clone(), window: window.clone(), }); @@ -289,7 +289,7 @@ extern "C" fn on_surface_created_cb(xcomponent: *mut OH_NativeXComponent, window let xc_wrapper = XComponentWrapper(xcomponent); let window_wrapper = WindowWrapper(window); - if !SERVO_CHANNEL.get().is_some() { + if SERVO_CHANNEL.get().is_none() { // Todo: Perhaps it would be better to move this thread into the vsync signal thread. // This would allow us to save one thread and the IPC for the vsync signal. // @@ -526,7 +526,7 @@ fn initialize_logging_once() { ONCE.call_once(|| { let logger: &'static hilog::Logger = &LOGGER; let max_level = logger.filter(); - let r = log::set_logger(logger).and_then(|()| Ok(log::set_max_level(max_level))); + let r = log::set_logger(logger).map(|()| log::set_max_level(max_level)); debug!("Attempted to register the logger: {r:?} and set max level to: {max_level}"); info!("Servo Register callback called!"); diff --git a/ports/servoshell/egl/ohos/simpleservo.rs b/ports/servoshell/egl/ohos/simpleservo.rs index 76badaaa38b..e02fbf8fbda 100644 --- a/ports/servoshell/egl/ohos/simpleservo.rs +++ b/ports/servoshell/egl/ohos/simpleservo.rs @@ -2,7 +2,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ use std::cell::RefCell; -use std::ffi::{CString, c_char}; use std::fs; use std::os::raw::c_void; use std::path::PathBuf; @@ -10,7 +9,7 @@ use std::ptr::NonNull; use std::rc::Rc; use dpi::PhysicalSize; -use log::{debug, error, info, warn}; +use log::{debug, info, warn}; use ohos_abilitykit_sys::runtime::application_context; use ohos_window_manager_sys::display_manager; use raw_window_handle::{