From 9598eb371cccdba8fb10e3c4c63e2229f2058954 Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Sat, 3 May 2025 21:35:32 +0900 Subject: [PATCH] winit-core: fix tests --- winit-core/src/cursor.rs | 6 +++--- winit-core/src/event.rs | 4 ++-- winit-core/src/keyboard.rs | 4 ++-- winit-core/src/window.rs | 30 +++++++++++++++--------------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/winit-core/src/cursor.rs b/winit-core/src/cursor.rs index 47028ec8..9acebd40 100644 --- a/winit-core/src/cursor.rs +++ b/winit-core/src/cursor.rs @@ -51,10 +51,10 @@ impl From for Cursor { /// # Example /// /// ```no_run -/// # use winit::event_loop::ActiveEventLoop; -/// # use winit::window::Window; +/// # use winit_core::event_loop::ActiveEventLoop; +/// # use winit_core::window::Window; /// # fn scope(event_loop: &dyn ActiveEventLoop, window: &dyn Window) { -/// use winit::window::CustomCursorSource; +/// use winit_core::cursor::CustomCursorSource; /// /// let w = 10; /// let h = 10; diff --git a/winit-core/src/event.rs b/winit-core/src/event.rs index 29a5a947..40e46dff 100644 --- a/winit-core/src/event.rs +++ b/winit-core/src/event.rs @@ -752,8 +752,8 @@ pub struct KeyEvent { /// done by ignoring events where this property is set. /// /// ```no_run - /// use winit::event::{ElementState, KeyEvent, WindowEvent}; - /// use winit::keyboard::{KeyCode, PhysicalKey}; + /// use winit_core::event::{ElementState, KeyEvent, WindowEvent}; + /// use winit_core::keyboard::{KeyCode, PhysicalKey}; /// # let window_event = WindowEvent::RedrawRequested; // To make the example compile /// match window_event { /// WindowEvent::KeyboardInput { diff --git a/winit-core/src/keyboard.rs b/winit-core/src/keyboard.rs index 3f41d1c6..216eb8fa 100644 --- a/winit-core/src/keyboard.rs +++ b/winit-core/src/keyboard.rs @@ -1564,7 +1564,7 @@ impl NamedKey { /// # wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); /// # #[cfg_attr(web_platform, wasm_bindgen_test::wasm_bindgen_test)] /// # fn main() { - /// use winit::keyboard::NamedKey; + /// use winit_core::keyboard::NamedKey; /// /// assert_eq!(NamedKey::Enter.to_text(), Some("\r")); /// assert_eq!(NamedKey::F20.to_text(), None); @@ -1591,7 +1591,7 @@ impl Key { /// # wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); /// # #[cfg_attr(web_platform, wasm_bindgen_test::wasm_bindgen_test)] /// # fn main() { - /// use winit::keyboard::{Key, NamedKey}; + /// use winit_core::keyboard::{Key, NamedKey}; /// /// assert_eq!(Key::Character("a".into()).to_text(), Some("a")); /// assert_eq!(Key::Named(NamedKey::Enter).to_text(), Some("\r")); diff --git a/winit-core/src/window.rs b/winit-core/src/window.rs index e00e9dd2..742ae2db 100644 --- a/winit-core/src/window.rs +++ b/winit-core/src/window.rs @@ -581,7 +581,7 @@ pub trait Window: AsAny + Send + Sync + fmt::Debug { /// APIs and software rendering. /// /// ```no_run - /// # use winit::window::Window; + /// # use winit_core::window::Window; /// # fn swap_buffers() {} /// # fn scope(window: &dyn Window) { /// // Do the actual drawing with OpenGL. @@ -657,8 +657,8 @@ pub trait Window: AsAny + Send + Sync + fmt::Debug { /// This automatically un-maximizes the window if it's maximized. /// /// ```no_run - /// # use winit::dpi::{LogicalPosition, PhysicalPosition}; - /// # use winit::window::Window; + /// # use dpi::{LogicalPosition, PhysicalPosition}; + /// # use winit_core::window::Window; /// # fn scope(window: &dyn Window) { /// // Specify the position in logical dimensions like this: /// window.set_outer_position(LogicalPosition::new(400.0, 200.0).into()); @@ -715,8 +715,8 @@ pub trait Window: AsAny + Send + Sync + fmt::Debug { /// The request could automatically un-maximize the window if it's maximized. /// /// ```no_run - /// # use winit::dpi::{LogicalSize, PhysicalSize}; - /// # use winit::window::Window; + /// # use dpi::{LogicalSize, PhysicalSize}; + /// # use winit_core::window::Window; /// # fn scope(window: &dyn Window) { /// // Specify the size in logical dimensions like this: /// let _ = window.request_surface_size(LogicalSize::new(400.0, 200.0).into()); @@ -772,7 +772,7 @@ pub trait Window: AsAny + Send + Sync + fmt::Debug { /// Convert safe area insets to a size and a position. /// /// ``` - /// use winit::dpi::{PhysicalPosition, PhysicalSize}; + /// use dpi::{PhysicalPosition, PhysicalSize}; /// /// # let surface_size = dpi::PhysicalSize::new(0, 0); /// # #[cfg(requires_window)] @@ -792,8 +792,8 @@ pub trait Window: AsAny + Send + Sync + fmt::Debug { /// Sets a minimum dimensions of the window's surface. /// /// ```no_run - /// # use winit::dpi::{LogicalSize, PhysicalSize}; - /// # use winit::window::Window; + /// # use dpi::{LogicalSize, PhysicalSize}; + /// # use winit_core::window::Window; /// # fn scope(window: &dyn Window) { /// // Specify the size in logical dimensions like this: /// window.set_min_surface_size(Some(LogicalSize::new(400.0, 200.0).into())); @@ -811,8 +811,8 @@ pub trait Window: AsAny + Send + Sync + fmt::Debug { /// Sets a maximum dimensions of the window's surface. /// /// ```no_run - /// # use winit::dpi::{LogicalSize, PhysicalSize}; - /// # use winit::window::Window; + /// # use dpi::{LogicalSize, PhysicalSize}; + /// # use winit_core::window::Window; /// # fn scope(window: &dyn Window) { /// // Specify the size in logical dimensions like this: /// window.set_max_surface_size(Some(LogicalSize::new(400.0, 200.0).into())); @@ -1071,8 +1071,8 @@ pub trait Window: AsAny + Send + Sync + fmt::Debug { /// ## Example /// /// ```no_run - /// # use winit::dpi::{LogicalPosition, PhysicalPosition, LogicalSize, PhysicalSize}; - /// # use winit::window::Window; + /// # use dpi::{LogicalPosition, PhysicalPosition, LogicalSize, PhysicalSize}; + /// # use winit_core::window::Window; /// # fn scope(window: &dyn Window) { /// // Specify the position in logical dimensions like this: /// window.set_ime_cursor_area( @@ -1214,8 +1214,8 @@ pub trait Window: AsAny + Send + Sync + fmt::Debug { /// Changes the position of the cursor in window coordinates. /// /// ```no_run - /// # use winit::dpi::{LogicalPosition, PhysicalPosition}; - /// # use winit::window::Window; + /// # use dpi::{LogicalPosition, PhysicalPosition}; + /// # use winit_core::window::Window; /// # fn scope(window: &dyn Window) { /// // Specify the position in logical dimensions like this: /// window.set_cursor_position(LogicalPosition::new(400.0, 200.0).into()); @@ -1238,7 +1238,7 @@ pub trait Window: AsAny + Send + Sync + fmt::Debug { /// First try confining the cursor, and if that fails, try locking it instead. /// /// ```no_run - /// # use winit::window::{CursorGrabMode, Window}; + /// # use winit_core::window::{CursorGrabMode, Window}; /// # fn scope(window: &dyn Window) { /// window /// .set_cursor_grab(CursorGrabMode::Confined)