Rustfmt: use group_imports

This commit is contained in:
daxpedda 2024-07-07 18:38:50 +02:00
parent 936da131c2
commit 2665c12098
No known key found for this signature in database
GPG key ID: 43D62A3EA388E46F
86 changed files with 225 additions and 276 deletions

View file

@ -1,5 +1,6 @@
use std::cell::Cell;
use std::rc::Rc;
use wasm_bindgen::closure::Closure;
use wasm_bindgen::JsCast;

View file

@ -11,13 +11,6 @@ use web_sys::{
PointerEvent, WheelEvent,
};
use crate::dpi::{LogicalPosition, PhysicalPosition, PhysicalSize};
use crate::error::OsError as RootOE;
use crate::event::{Force, InnerSizeWriter, MouseButton, MouseScrollDelta};
use crate::keyboard::{Key, KeyLocation, ModifiersState, PhysicalKey};
use crate::platform_impl::OsError;
use crate::window::{WindowAttributes, WindowId as RootWindowId};
use super::super::cursor::CursorHandler;
use super::super::main_thread::MainThreadMarker;
use super::super::WindowId;
@ -27,6 +20,12 @@ use super::intersection_handle::IntersectionObserverHandle;
use super::media_query_handle::MediaQueryListHandle;
use super::pointer::PointerHandler;
use super::{event, fullscreen, ButtonsState, ResizeScaleHandle};
use crate::dpi::{LogicalPosition, PhysicalPosition, PhysicalSize};
use crate::error::OsError as RootOE;
use crate::event::{Force, InnerSizeWriter, MouseButton, MouseScrollDelta};
use crate::keyboard::{Key, KeyLocation, ModifiersState, PhysicalKey};
use crate::platform_impl::OsError;
use crate::window::{WindowAttributes, WindowId as RootWindowId};
#[allow(dead_code)]
pub struct Canvas {

View file

@ -1,14 +1,14 @@
use crate::event::{MouseButton, MouseScrollDelta};
use crate::keyboard::{Key, KeyLocation, ModifiersState, NamedKey, PhysicalKey};
use std::cell::OnceCell;
use dpi::{LogicalPosition, PhysicalPosition, Position};
use smol_str::SmolStr;
use std::cell::OnceCell;
use wasm_bindgen::prelude::wasm_bindgen;
use wasm_bindgen::{JsCast, JsValue};
use web_sys::{KeyboardEvent, MouseEvent, PointerEvent, WheelEvent};
use super::Engine;
use crate::event::{MouseButton, MouseScrollDelta};
use crate::keyboard::{Key, KeyLocation, ModifiersState, NamedKey, PhysicalKey};
bitflags::bitflags! {
// https://www.w3.org/TR/pointerevents3/#the-buttons-property

View file

@ -11,13 +11,6 @@ mod schedule;
use std::sync::OnceLock;
pub use self::canvas::{Canvas, Style};
pub use self::event::ButtonsState;
pub use self::event_handle::EventListenerHandle;
pub use self::resize_scaling::ResizeScaleHandle;
pub use self::schedule::Schedule;
use crate::dpi::{LogicalPosition, LogicalSize};
use js_sys::Array;
use wasm_bindgen::closure::Closure;
use wasm_bindgen::prelude::wasm_bindgen;
@ -26,6 +19,13 @@ use web_sys::{
Document, HtmlCanvasElement, Navigator, PageTransitionEvent, VisibilityState, Window,
};
pub use self::canvas::{Canvas, Style};
pub use self::event::ButtonsState;
pub use self::event_handle::EventListenerHandle;
pub use self::resize_scaling::ResizeScaleHandle;
pub use self::schedule::Schedule;
use crate::dpi::{LogicalPosition, LogicalSize};
pub fn throw(msg: &str) {
wasm_bindgen::throw_str(msg);
}

View file

@ -1,6 +1,9 @@
use std::cell::Cell;
use std::rc::Rc;
use event::ButtonsState;
use web_sys::PointerEvent;
use super::canvas::Common;
use super::event;
use super::event_handle::EventListenerHandle;
@ -8,9 +11,6 @@ use crate::dpi::PhysicalPosition;
use crate::event::{Force, MouseButton};
use crate::keyboard::ModifiersState;
use event::ButtonsState;
use web_sys::PointerEvent;
#[allow(dead_code)]
pub(super) struct PointerHandler {
on_cursor_leave: Option<EventListenerHandle<dyn FnMut(PointerEvent)>>,

View file

@ -1,3 +1,6 @@
use std::cell::{Cell, RefCell};
use std::rc::Rc;
use js_sys::{Array, Object};
use tracing::warn;
use wasm_bindgen::prelude::{wasm_bindgen, Closure};
@ -7,14 +10,10 @@ use web_sys::{
ResizeObserverEntry, ResizeObserverOptions, ResizeObserverSize, Window,
};
use crate::dpi::{LogicalSize, PhysicalSize};
use super::super::backend;
use super::canvas::Style;
use super::media_query_handle::MediaQueryListHandle;
use std::cell::{Cell, RefCell};
use std::rc::Rc;
use crate::dpi::{LogicalSize, PhysicalSize};
pub struct ResizeScaleHandle(Rc<ResizeScaleInternal>);

View file

@ -1,6 +1,7 @@
use js_sys::{Array, Function, Object, Promise, Reflect};
use std::cell::OnceCell;
use std::time::Duration;
use js_sys::{Array, Function, Object, Promise, Reflect};
use wasm_bindgen::closure::Closure;
use wasm_bindgen::prelude::wasm_bindgen;
use wasm_bindgen::{JsCast, JsValue};