Update rustfmt to the 2024 style edition (#35764)

* Use 2024 style edition

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Reformat all code

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2025-03-03 12:26:53 +01:00 committed by GitHub
parent 6300e820b4
commit 3d320fa96a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
603 changed files with 1739 additions and 1648 deletions

View file

@ -23,7 +23,7 @@ use servo::{
AlertResponse, LoadStatus, MediaSessionActionType, PermissionRequest, SimpleDialog, WebView,
};
use simpleservo::{
DeviceIntRect, EventLoopWaker, InitOptions, InputMethodType, MediaSessionPlaybackState, APP,
APP, DeviceIntRect, EventLoopWaker, InitOptions, InputMethodType, MediaSessionPlaybackState,
};
use super::app_state::{Coordinates, RunningAppState};

View file

@ -8,12 +8,12 @@ use std::rc::Rc;
use dpi::PhysicalSize;
use raw_window_handle::{DisplayHandle, RawDisplayHandle, RawWindowHandle, WindowHandle};
pub use servo::webrender_api::units::DeviceIntRect;
/// The EventLoopWaker::wake function will be called from any thread.
/// It will be called to notify embedder that some events are available,
/// and that perform_updates need to be called
pub use servo::EventLoopWaker;
use servo::{self, resources, Servo};
pub use servo::webrender_api::units::DeviceIntRect;
use servo::{self, Servo, resources};
pub use servo::{InputMethodType, MediaSessionPlaybackState, WindowRenderingContext};
use crate::egl::android::resources::ResourceReaderInstance;
@ -21,7 +21,7 @@ use crate::egl::app_state::{
Coordinates, RunningAppState, ServoEmbedderCallbacks, ServoWindowCallbacks,
};
use crate::egl::host_trait::HostTrait;
use crate::prefs::{parse_command_line_arguments, ArgumentParsingResult};
use crate::prefs::{ArgumentParsingResult, parse_command_line_arguments};
thread_local! {
pub static APP: RefCell<Option<Rc<RunningAppState>>> = const { RefCell::new(None) };

View file

@ -16,8 +16,8 @@ use servo::compositing::windowing::{
};
use servo::euclid::{Box2D, Point2D, Rect, Scale, Size2D, Vector2D};
use servo::servo_geometry::DeviceIndependentPixel;
use servo::webrender_api::units::{DeviceIntRect, DeviceIntSize, DevicePixel};
use servo::webrender_api::ScrollLocation;
use servo::webrender_api::units::{DeviceIntRect, DeviceIntSize, DevicePixel};
use servo::{
AllowOrDenyRequest, ContextMenuResult, EmbedderProxy, EventLoopWaker, ImeEvent, InputEvent,
InputMethodType, Key, KeyState, KeyboardEvent, LoadStatus, MediaSessionActionType,

View file

@ -63,7 +63,9 @@ pub(crate) fn redirect_stdout_and_stderr() -> Result<(), LogRedirectError> {
Ok(bytes) => bytes + cursor,
Err(nix::errno::Errno::EINTR) => continue,
Err(e) => {
error!("Failed to read from redirected stdout/stderr pipe due to {e:?}. Closing log thread");
error!(
"Failed to read from redirected stdout/stderr pipe due to {e:?}. Closing log thread"
);
return;
},
};

View file

@ -7,13 +7,13 @@ use std::cell::RefCell;
use std::mem::MaybeUninit;
use std::os::raw::c_void;
use std::sync::mpsc::{Receiver, Sender};
use std::sync::{mpsc, Once, OnceLock};
use std::sync::{Once, OnceLock, mpsc};
use std::thread;
use std::thread::sleep;
use std::time::Duration;
use keyboard_types::Key;
use log::{debug, error, info, trace, warn, LevelFilter};
use log::{LevelFilter, debug, error, info, trace, warn};
use napi_derive_ohos::{module_exports, napi};
use napi_ohos::bindgen_prelude::Function;
use napi_ohos::threadsafe_function::{ThreadsafeFunction, ThreadsafeFunctionCallMode};

View file

@ -17,16 +17,16 @@ use raw_window_handle::{
/// It will be called to notify embedder that some events are available,
/// and that perform_updates need to be called
pub use servo::EventLoopWaker;
use servo::{self, resources, Servo, WindowRenderingContext};
use servo::{self, Servo, WindowRenderingContext, resources};
use xcomponent_sys::OH_NativeXComponent;
use crate::egl::app_state::{
Coordinates, RunningAppState, ServoEmbedderCallbacks, ServoWindowCallbacks,
};
use crate::egl::host_trait::HostTrait;
use crate::egl::ohos::resources::ResourceReaderInstance;
use crate::egl::ohos::InitOpts;
use crate::prefs::{parse_command_line_arguments, ArgumentParsingResult};
use crate::egl::ohos::resources::ResourceReaderInstance;
use crate::prefs::{ArgumentParsingResult, parse_command_line_arguments};
/// Initialize Servo. At that point, we need a valid GL context.
/// In the future, this will be done in multiple steps.