From baf10de95843f156b0fbad6b10c3137f1ebd4f1e Mon Sep 17 00:00:00 2001 From: daxpedda Date: Sat, 16 Mar 2024 10:22:29 +0100 Subject: [PATCH] Prefer `[foo][bar]` over `[foo](bar)` for intra-doc links (#3191) --- src/application.rs | 2 +- src/cursor.rs | 2 +- src/event.rs | 8 ++++---- src/event_loop.rs | 6 +++--- src/keyboard.rs | 2 +- src/lib.rs | 2 +- src/monitor.rs | 4 ++-- src/platform/web.rs | 2 +- src/platform/windows.rs | 2 +- src/platform_impl/web/web_sys/canvas.rs | 2 +- src/window.rs | 4 ++-- 11 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/application.rs b/src/application.rs index acb5af0979..024c0e033e 100644 --- a/src/application.rs +++ b/src/application.rs @@ -11,7 +11,7 @@ pub trait ApplicationHandler { /// This is a useful place to put code that should be done before you start processing /// events, such as updating frame timing information for benchmarking or checking the /// [`StartCause`] to see if a timer set by - /// [`ControlFlow::WaitUntil`](crate::event_loop::ControlFlow::WaitUntil) has elapsed. + /// [`ControlFlow::WaitUntil`][crate::event_loop::ControlFlow::WaitUntil] has elapsed. fn new_events(&mut self, event_loop: &ActiveEventLoop, cause: StartCause) { let _ = (event_loop, cause); } diff --git a/src/cursor.rs b/src/cursor.rs index 27e7f8a7d3..b36eadd174 100644 --- a/src/cursor.rs +++ b/src/cursor.rs @@ -12,7 +12,7 @@ pub const MAX_CURSOR_SIZE: u16 = 2048; const PIXEL_SIZE: usize = 4; -/// See [`Window::set_cursor()`](crate::window::Window::set_cursor) for more details. +/// See [`Window::set_cursor()`][crate::window::Window::set_cursor] for more details. #[derive(Clone, Debug, Eq, Hash, PartialEq)] pub enum Cursor { Icon(CursorIcon), diff --git a/src/event.rs b/src/event.rs index e2bca908be..e1975c657a 100644 --- a/src/event.rs +++ b/src/event.rs @@ -790,8 +790,8 @@ impl From for Modifiers { pub enum Ime { /// Notifies when the IME was enabled. /// - /// After getting this event you could receive [`Preedit`](Self::Preedit) and - /// [`Commit`](Self::Commit) events. You should also start performing IME related requests + /// After getting this event you could receive [`Preedit`][Self::Preedit] and + /// [`Commit`][Self::Commit] events. You should also start performing IME related requests /// like [`Window::set_ime_cursor_area`]. Enabled, @@ -811,8 +811,8 @@ pub enum Ime { /// Notifies when the IME was disabled. /// - /// After receiving this event you won't get any more [`Preedit`](Self::Preedit) or - /// [`Commit`](Self::Commit) events until the next [`Enabled`](Self::Enabled) event. You should + /// After receiving this event you won't get any more [`Preedit`][Self::Preedit] or + /// [`Commit`][Self::Commit] events until the next [`Enabled`][Self::Enabled] event. You should /// also stop issuing IME related requests like [`Window::set_ime_cursor_area`] and clear pending /// preedit text. Disabled, diff --git a/src/event_loop.rs b/src/event_loop.rs index af99ea1bda..48455e3062 100644 --- a/src/event_loop.rs +++ b/src/event_loop.rs @@ -3,7 +3,7 @@ //! //! If you want to send custom events to the event loop, use //! [`EventLoop::create_proxy`] to acquire an [`EventLoopProxy`] and call its -//! [`send_event`](`EventLoopProxy::send_event`) method. +//! [`send_event`][EventLoopProxy::send_event] method. //! //! See the root-level documentation for information on how to create and use an event loop to //! handle events. @@ -468,7 +468,7 @@ impl ActiveEventLoop { /// This exits the event loop. /// - /// See [`LoopExiting`](Event::LoopExiting). + /// See [`LoopExiting`][Event::LoopExiting]. pub fn exit(&self) { let _span = tracing::debug_span!("winit::ActiveEventLoop::exit",).entered(); @@ -477,7 +477,7 @@ impl ActiveEventLoop { /// Returns if the [`EventLoop`] is about to stop. /// - /// See [`exit()`](Self::exit). + /// See [`exit()`][Self::exit]. pub fn exiting(&self) -> bool { self.p.exiting() } diff --git a/src/keyboard.rs b/src/keyboard.rs index 4fc9fdb027..94f6863a5c 100644 --- a/src/keyboard.rs +++ b/src/keyboard.rs @@ -218,7 +218,7 @@ impl PartialEq for NativeKey { /// Represents the location of a physical key. /// -/// This type is a superset of [`KeyCode`], including an [`Unidentified`](Self::Unidentified) +/// This type is a superset of [`KeyCode`], including an [`Unidentified`][Self::Unidentified] /// variant. #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] diff --git a/src/lib.rs b/src/lib.rs index 1543dd3a52..7880121769 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -124,7 +124,7 @@ //! Note that many platforms will display garbage data in the window's client area if the //! application doesn't render anything to the window by the time the desktop compositor is ready to //! display the window to the user. If you notice this happening, you should create the window with -//! [`visible` set to `false`](crate::window::WindowAttributes::with_visible) and explicitly make the +//! [`visible` set to `false`][crate::window::WindowAttributes::with_visible] and explicitly make the //! window visible only once you're ready to render into it. //! //! # UI scaling diff --git a/src/monitor.rs b/src/monitor.rs index f856d601ec..5c522b104b 100644 --- a/src/monitor.rs +++ b/src/monitor.rs @@ -3,8 +3,8 @@ //! If you want to get basic information about a monitor, you can use the //! [`MonitorHandle`] type. This is retrieved from one of the following //! methods, which return an iterator of [`MonitorHandle`]: -//! - [`ActiveEventLoop::available_monitors`](crate::event_loop::ActiveEventLoop::available_monitors). -//! - [`Window::available_monitors`](crate::window::Window::available_monitors). +//! - [`ActiveEventLoop::available_monitors`][crate::event_loop::ActiveEventLoop::available_monitors]. +//! - [`Window::available_monitors`][crate::window::Window::available_monitors]. use crate::{ dpi::{PhysicalPosition, PhysicalSize}, platform_impl, diff --git a/src/platform/web.rs b/src/platform/web.rs index dfca6cf54b..1209b50c6e 100644 --- a/src/platform/web.rs +++ b/src/platform/web.rs @@ -252,7 +252,7 @@ impl ActiveEventLoopExtWebSys for ActiveEventLoop { } } -/// Strategy used for [`ControlFlow::Poll`](crate::event_loop::ControlFlow::Poll). +/// Strategy used for [`ControlFlow::Poll`][crate::event_loop::ControlFlow::Poll]. #[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] pub enum PollStrategy { /// Uses [`Window.requestIdleCallback()`] to queue the next event loop. If not available diff --git a/src/platform/windows.rs b/src/platform/windows.rs index 39e4ee0163..9857e9e9bd 100644 --- a/src/platform/windows.rs +++ b/src/platform/windows.rs @@ -305,7 +305,7 @@ impl WindowExtWindows for Window { pub trait WindowAttributesExtWindows { /// Set an owner to the window to be created. Can be used to create a dialog box, for example. /// This only works when [`WindowAttributes::with_parent_window`] isn't called or set to `None`. - /// Can be used in combination with [`WindowExtWindows::set_enable(false)`](WindowExtWindows::set_enable) + /// Can be used in combination with [`WindowExtWindows::set_enable(false)`][WindowExtWindows::set_enable] /// on the owner window to create a modal dialog box. /// /// From MSDN: diff --git a/src/platform_impl/web/web_sys/canvas.rs b/src/platform_impl/web/web_sys/canvas.rs index eb836a870f..f47b2dc3f6 100644 --- a/src/platform_impl/web/web_sys/canvas.rs +++ b/src/platform_impl/web/web_sys/canvas.rs @@ -54,7 +54,7 @@ pub struct Common { pub window: web_sys::Window, pub document: Document, /// Note: resizing the HTMLCanvasElement should go through `backend::set_canvas_size` to ensure the DPI factor is maintained. - /// Note: this is read-only because we use a pointer to this for [`WindowHandle`](rwh_06::WindowHandle). + /// Note: this is read-only because we use a pointer to this for [`WindowHandle`][rwh_06::WindowHandle]. raw: Rc, style: Style, old_size: Rc>>, diff --git a/src/window.rs b/src/window.rs index e3c456d4b7..9458a4763f 100644 --- a/src/window.rs +++ b/src/window.rs @@ -63,7 +63,7 @@ impl Drop for Window { /// Identifier of a window. Unique for each window. /// -/// Can be obtained with [`window.id()`](`Window::id`). +/// Can be obtained with [`window.id()`][`Window::id`]. /// /// Whenever you receive an event specific to a window, this event contains a `WindowId` which you /// can then compare to the ids of your windows. @@ -1477,7 +1477,7 @@ impl Window { .maybe_wait_on_main(|w| w.set_cursor_position(position)) } - /// Set grabbing [mode](CursorGrabMode) on the cursor preventing it from leaving the window. + /// Set grabbing [mode][CursorGrabMode] on the cursor preventing it from leaving the window. /// /// # Example ///