From 1337a0f5ea75d36cb2f14969e7f44a7728bf7f91 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Mon, 31 Jul 2023 06:37:50 +0700 Subject: [PATCH] docs: Fix more legacy linking. (#124) --- src/application.rs | 23 +++++++---------------- src/mouse.rs | 10 ---------- src/pointer.rs | 10 ---------- src/scale.rs | 9 +++------ 4 files changed, 10 insertions(+), 42 deletions(-) diff --git a/src/application.rs b/src/application.rs index 69575ab2..ce368eeb 100644 --- a/src/application.rs +++ b/src/application.rs @@ -91,20 +91,16 @@ impl Application { /// Get the current globally active `Application`. /// - /// A globally active `Application` exists - /// after [`new`] is called and until [`run`] returns. + /// A globally active `Application` exists after [`Application::new()`] + /// is called and until [`Application::run()`] returns. /// /// # Panics /// /// Panics if there is no globally active `Application`. - /// For a non-panicking function use [`try_global`]. + /// For a non-panicking function use [`Application::try_global()`]. /// /// This function will also panic if called from a non-main thread. /// Use [`AppHandle`] instead. - /// - /// [`new`]: #method.new - /// [`run`]: #method.run - /// [`try_global`]: #method.try_global #[inline] pub fn global() -> Application { // Main thread assertion takes place in try_global() @@ -113,15 +109,12 @@ impl Application { /// Get the current globally active `Application`. /// - /// A globally active `Application` exists - /// after [`new`] is called and until [`run`] returns. + /// A globally active `Application` exists after [`Application::new()`] + /// is called and until [`Application::run()`] returns. /// /// # Panics /// /// Panics if called from a non-main thread. - /// - /// [`new`]: #method.new - /// [`run`]: #method.run pub fn try_global() -> Option { util::assert_main_thread_or_main_unclaimed(); GLOBAL_APP.with(|global_app| global_app.borrow().clone()) @@ -165,9 +158,7 @@ impl Application { /// Quit the `Application`. /// - /// This will cause [`run`] to return control back to the calling function. - /// - /// [`run`]: #method.run + /// This will cause [`Application::run`] to return control back to the calling function. pub fn quit(&self) { self.backend_app.quit() } @@ -179,7 +170,7 @@ impl Application { /// Returns the current locale string. /// - /// This should a [Unicode language identifier]. + /// This should be a [Unicode language identifier]. /// /// [Unicode language identifier]: https://unicode.org/reports/tr35/#Unicode_language_identifier pub fn get_locale() -> String { diff --git a/src/mouse.rs b/src/mouse.rs index 2e1b37a6..ae53da6c 100644 --- a/src/mouse.rs +++ b/src/mouse.rs @@ -77,40 +77,30 @@ pub enum MouseButton { impl MouseButton { /// Returns `true` if this is [`MouseButton::Left`]. - /// - /// [`MouseButton::Left`]: #variant.Left #[inline] pub fn is_left(self) -> bool { self == MouseButton::Left } /// Returns `true` if this is [`MouseButton::Right`]. - /// - /// [`MouseButton::Right`]: #variant.Right #[inline] pub fn is_right(self) -> bool { self == MouseButton::Right } /// Returns `true` if this is [`MouseButton::Middle`]. - /// - /// [`MouseButton::Middle`]: #variant.Middle #[inline] pub fn is_middle(self) -> bool { self == MouseButton::Middle } /// Returns `true` if this is [`MouseButton::X1`]. - /// - /// [`MouseButton::X1`]: #variant.X1 #[inline] pub fn is_x1(self) -> bool { self == MouseButton::X1 } /// Returns `true` if this is [`MouseButton::X2`]. - /// - /// [`MouseButton::X2`]: #variant.X2 #[inline] pub fn is_x2(self) -> bool { self == MouseButton::X2 diff --git a/src/pointer.rs b/src/pointer.rs index ff969c52..817683f9 100644 --- a/src/pointer.rs +++ b/src/pointer.rs @@ -239,40 +239,30 @@ impl From for PointerButton { impl PointerButton { /// Returns `true` if this is [`PointerButton::Left`]. - /// - /// [`MouseButton::Left`]: #variant.Left #[inline] pub fn is_left(self) -> bool { self == PointerButton::Left } /// Returns `true` if this is [`PointerButton::Right`]. - /// - /// [`PointerButton::Right`]: #variant.Right #[inline] pub fn is_right(self) -> bool { self == PointerButton::Right } /// Returns `true` if this is [`PointerButton::Middle`]. - /// - /// [`PointerButton::Middle`]: #variant.Middle #[inline] pub fn is_middle(self) -> bool { self == PointerButton::Middle } /// Returns `true` if this is [`PointerButton::X1`]. - /// - /// [`PointerButton::X1`]: #variant.X1 #[inline] pub fn is_x1(self) -> bool { self == PointerButton::X1 } /// Returns `true` if this is [`PointerButton::X2`]. - /// - /// [`PointerButton::X2`]: #variant.X2 #[inline] pub fn is_x2(self) -> bool { self == PointerButton::X2 diff --git a/src/scale.rs b/src/scale.rs index 6243c96b..6e0b561a 100644 --- a/src/scale.rs +++ b/src/scale.rs @@ -33,15 +33,13 @@ use crate::kurbo::{Insets, Line, Point, Rect, Size, Vec2}; /// ## Converting with `Scale` /// /// To translate coordinates between pixels and display points you should use one of the -/// helper conversion methods of `Scale` or for manual conversion [`x`] / [`y`]. +/// helper conversion methods of `Scale` or for manual conversion [`Scale::x()`] / [`Scale::y()`]. /// /// `Scale` is designed for responsive applications, including responding to platform scale changes. /// The platform scale can change quickly, e.g. when moving a window from one monitor to another. /// /// A copy of `Scale` will be stale as soon as the platform scale changes. /// -/// [`x`]: #method.x -/// [`y`]: #method.y /// [in the Druid book]: https://linebender.org/druid/07_resolution_independence.html #[derive(Copy, Clone, PartialEq, Debug)] pub struct Scale { @@ -277,9 +275,8 @@ impl ScaledArea { /// /// The calculated size in pixels is rounded away from zero to integers. /// That means that the scaled area size in display points isn't always the same - /// as the `size` given to this function. To find out the new size in points use [`size_dp`]. - /// - /// [`size_dp`]: #method.size_dp + /// as the `size` given to this function. To find out the new size in points use + /// [`ScaledArea::size_dp()`]. pub fn from_dp>(size: T, scale: Scale) -> ScaledArea { let size_px = size.into().to_px(scale).expand(); let size_dp = size_px.to_dp(scale);