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

@ -14,8 +14,8 @@ pub(crate) fn setup_gl_accelerated_media(_: RefMut<Device>, _: RefMut<Context>)
#[cfg(all(target_os = "linux", not(target_env = "ohos")))]
pub(crate) fn setup_gl_accelerated_media(device: RefMut<Device>, context: RefMut<Context>) {
use servo::media::{GlContext, NativeDisplay};
use servo::Servo;
use servo::media::{GlContext, NativeDisplay};
use surfman::platform::generic::multi::connection::NativeConnection;
use surfman::platform::generic::multi::context::NativeContext;
@ -43,8 +43,8 @@ pub(crate) fn setup_gl_accelerated_media(device: RefMut<Device>, context: RefMut
#[cfg(target_os = "windows")]
pub(crate) fn setup_gl_accelerated_media(device: RefMut<Device>, context: RefMut<Context>) {
use servo::media::{GlContext, NativeDisplay};
use servo::Servo;
use servo::media::{GlContext, NativeDisplay};
let api = api(&device, &context);
let context = GlContext::Egl(device.native_context(&context).egl_context as usize);

View file

@ -14,8 +14,8 @@ use log::{error, info};
use servo::base::id::WebViewId;
use servo::config::pref;
use servo::ipc_channel::ipc::IpcSender;
use servo::webrender_api::units::{DeviceIntPoint, DeviceIntRect, DeviceIntSize};
use servo::webrender_api::ScrollLocation;
use servo::webrender_api::units::{DeviceIntPoint, DeviceIntRect, DeviceIntSize};
use servo::{
AllowOrDenyRequest, AuthenticationRequest, FilterPattern, GamepadHapticEffectType, LoadStatus,
PermissionRequest, Servo, ServoDelegate, ServoError, SimpleDialog, TouchEventType, WebView,
@ -27,7 +27,7 @@ use super::app::PumpResult;
use super::dialog::Dialog;
use super::gamepad::GamepadSupport;
use super::keyutils::CMD_OR_CONTROL;
use super::window_trait::{WindowPortsMethods, LINE_HEIGHT};
use super::window_trait::{LINE_HEIGHT, WindowPortsMethods};
use crate::prefs::ServoShellPreferences;
pub(crate) enum AppState {

View file

@ -7,7 +7,7 @@ use std::{env, panic};
use crate::desktop::app::App;
use crate::desktop::events_loop::EventsLoop;
use crate::panic_hook;
use crate::prefs::{parse_command_line_arguments, ArgumentParsingResult};
use crate::prefs::{ArgumentParsingResult, parse_command_line_arguments};
pub fn main() {
crate::crash_handler::install();

View file

@ -36,8 +36,8 @@
use egui::{ViewportId, ViewportOutput};
use egui_glow::ShaderVersion;
pub use egui_winit;
use egui_winit::winit;
pub use egui_winit::EventResponse;
use egui_winit::winit;
use winit::event_loop::ActiveEventLoop;
/// Use [`egui`] from a [`glow`] app based on [`winit`].

View file

@ -19,8 +19,8 @@ use servo::compositing::windowing::{
};
use servo::servo_config::pref;
use servo::servo_geometry::DeviceIndependentPixel;
use servo::webrender_api::units::{DeviceIntPoint, DeviceIntRect, DeviceIntSize, DevicePixel};
use servo::webrender_api::ScrollLocation;
use servo::webrender_api::units::{DeviceIntPoint, DeviceIntRect, DeviceIntSize, DevicePixel};
use servo::{
Cursor, ImeEvent, InputEvent, Key, KeyState, KeyboardEvent, MouseButton as ServoMouseButton,
MouseButtonAction, MouseButtonEvent, MouseMoveEvent, OffscreenRenderingContext,
@ -40,8 +40,8 @@ use winit::window::Icon;
use super::app_state::RunningAppState;
use super::geometry::{winit_position_to_euclid_point, winit_size_to_euclid_size};
use super::keyutils::{keyboard_event_from_winit, CMD_OR_ALT};
use super::window_trait::{WindowPortsMethods, LINE_HEIGHT};
use super::keyutils::{CMD_OR_ALT, keyboard_event_from_winit};
use super::window_trait::{LINE_HEIGHT, WindowPortsMethods};
use crate::desktop::accelerated_gl_media::setup_gl_accelerated_media;
use crate::desktop::keyutils::CMD_OR_CONTROL;
use crate::prefs::ServoShellPreferences;

View file

@ -11,8 +11,8 @@ use dpi::PhysicalSize;
use egui::text::{CCursor, CCursorRange};
use egui::text_edit::TextEditState;
use egui::{
pos2, CentralPanel, Frame, Key, Label, Modifiers, PaintCallback, SelectableLabel,
TopBottomPanel, Vec2,
CentralPanel, Frame, Key, Label, Modifiers, PaintCallback, SelectableLabel, TopBottomPanel,
Vec2, pos2,
};
use egui_glow::CallbackFn;
use egui_winit::EventResponse;

View file

@ -16,10 +16,10 @@ use headers::{ContentType, HeaderMapExt};
use net::fetch::methods::{DoneChannel, FetchContext};
use net::filemanager_thread::FILE_CHUNK_SIZE;
use net::protocols::ProtocolHandler;
use net_traits::ResourceFetchTiming;
use net_traits::filemanager_thread::RelativePos;
use net_traits::request::Request;
use net_traits::response::{Response, ResponseBody};
use net_traits::ResourceFetchTiming;
use tokio::sync::mpsc::unbounded_channel;
#[derive(Default)]

View file

@ -8,10 +8,10 @@ use std::pin::Pin;
use headers::{ContentType, HeaderMapExt};
use net::fetch::methods::{DoneChannel, FetchContext};
use net::protocols::ProtocolHandler;
use net_traits::ResourceFetchTiming;
use net_traits::http_status::HttpStatus;
use net_traits::request::Request;
use net_traits::response::{Response, ResponseBody};
use net_traits::ResourceFetchTiming;
#[derive(Default)]
pub struct UrlInfoProtocolHander {}

View file

@ -35,7 +35,7 @@ pub trait WindowPortsMethods: WindowMethods {
fn set_title(&self, _title: &str) {}
/// Request a new inner size for the window, not including external decorations.
fn request_resize(&self, webview: &WebView, inner_size: DeviceIntSize)
-> Option<DeviceIntSize>;
-> Option<DeviceIntSize>;
fn set_position(&self, _point: DeviceIntPoint) {}
fn set_fullscreen(&self, _state: bool) {}
fn set_cursor(&self, _cursor: Cursor) {}