From 885d45f435e5874edd66b2ec6ba0484b99e73245 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Sat, 23 Aug 2025 02:41:52 +0200 Subject: [PATCH] Fix broken intra-doc links --- program/src/preset.rs | 4 ++-- test/src/error.rs | 2 +- test/src/lib.rs | 4 ++-- test/src/simulator.rs | 6 +++--- widget/src/container.rs | 4 ++-- widget/src/scrollable.rs | 8 ++++---- widget/src/text_input.rs | 14 +++++++------- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/program/src/preset.rs b/program/src/preset.rs index 863278ab..ba983f67 100644 --- a/program/src/preset.rs +++ b/program/src/preset.rs @@ -3,7 +3,7 @@ use crate::runtime::Task; use std::borrow::Cow; use std::fmt; -/// A specific boot strategy for a [`Program`]. +/// A specific boot strategy for a [`Program`](crate::Program). pub struct Preset { name: Cow<'static, str>, boot: Box (State, Task)>, @@ -26,7 +26,7 @@ impl Preset { &self.name } - /// Boots the [`Preset`], returning the initial [`Program`] state and + /// Boots the [`Preset`], returning the initial [`Program`](crate::Program) state and /// a [`Task`] for concurrent booting. pub fn boot(&self) -> (State, Task) { (self.boot)() diff --git a/test/src/error.rs b/test/src/error.rs index 45269a81..1e1de331 100644 --- a/test/src/error.rs +++ b/test/src/error.rs @@ -4,7 +4,7 @@ use std::sync::Arc; /// A test error. #[derive(Debug, Clone, thiserror::Error)] pub enum Error { - /// No matching widget was found for the [`Selector`]. + /// No matching widget was found for the [`Selector`](crate::Selector). #[error("no matching widget was found for the selector: {selector}")] NotFound { selector: String }, #[error("the matching target is not visible: {target:?}")] diff --git a/test/src/lib.rs b/test/src/lib.rs index 4ba2fe9c..baccc5e3 100644 --- a/test/src/lib.rs +++ b/test/src/lib.rs @@ -34,8 +34,8 @@ //! let _ = ui.click("-"); //! ``` //! -//! [`Simulator::click`] takes a [`Selector`]. A [`Selector`] describes a way to query the widgets of an interface. In this case, -//! [`selector::text`] lets us select a widget by the text it contains. +//! [`Simulator::click`] takes a type implementing the [`Selector`] trait. A [`Selector`] describes a way to query the widgets of an interface. +//! In this case, we leverage the [`Selector`] implementation of `&str`, which selects a widget by the text it contains. //! //! We can now process any messages produced by these interactions and then assert that the final value of our counter is //! indeed `1`! diff --git a/test/src/simulator.rs b/test/src/simulator.rs index a01bf28b..30f772a6 100644 --- a/test/src/simulator.rs +++ b/test/src/simulator.rs @@ -100,7 +100,7 @@ where } } - /// Finds the [`Target`] of the given widget [`Selector`] in the [`Simulator`]. + /// Finds the target of the given widget [`Selector`] in the [`Simulator`]. pub fn find(&mut self, selector: S) -> Result where S: Selector + Send, @@ -135,10 +135,10 @@ where self.cursor = mouse::Cursor::Available(position.into()); } - /// Clicks the [`Target`] found by the given [`Selector`], if any. + /// Clicks the [`Bounded`] target found by the given [`Selector`], if any. /// /// This consists in: - /// - Pointing the mouse cursor at the center of the [`Target`]. + /// - Pointing the mouse cursor at the center of the [`Bounded`] target. /// - Simulating a [`click`]. pub fn click(&mut self, selector: S) -> Result where diff --git a/widget/src/container.rs b/widget/src/container.rs index f3b1c8d1..a9883668 100644 --- a/widget/src/container.rs +++ b/widget/src/container.rs @@ -107,7 +107,7 @@ where } } - /// Sets the [`Id`] of the [`Container`]. + /// Sets the [`widget::Id`] of the [`Container`]. pub fn id(mut self, id: impl Into) -> Self { self.id = Some(id.into()); self @@ -458,7 +458,7 @@ pub fn draw_background( } /// Produces a [`Task`] that queries the visible screen bounds of the -/// [`Container`] with the given [`Id`]. +/// [`Container`] with the given [`widget::Id`]. pub fn visible_bounds(_id: impl Into) -> Task> { todo!() } diff --git a/widget/src/scrollable.rs b/widget/src/scrollable.rs index e5c0a728..67242334 100644 --- a/widget/src/scrollable.rs +++ b/widget/src/scrollable.rs @@ -149,7 +149,7 @@ where self.validate() } - /// Sets the [`Id`] of the [`Scrollable`]. + /// Sets the [`widget::Id`] of the [`Scrollable`]. pub fn id(mut self, id: impl Into) -> Self { self.id = Some(id.into()); self @@ -1262,7 +1262,7 @@ where } } -/// Produces a [`Task`] that snaps the [`Scrollable`] with the given [`Id`] +/// Produces a [`Task`] that snaps the [`Scrollable`] with the given [`widget::Id`] /// to the provided [`RelativeOffset`]. pub fn snap_to( id: impl Into, @@ -1274,7 +1274,7 @@ pub fn snap_to( ))) } -/// Produces a [`Task`] that scrolls the [`Scrollable`] with the given [`Id`] +/// Produces a [`Task`] that scrolls the [`Scrollable`] with the given [`widget::Id`] /// to the provided [`AbsoluteOffset`]. pub fn scroll_to( id: impl Into, @@ -1286,7 +1286,7 @@ pub fn scroll_to( ))) } -/// Produces a [`Task`] that scrolls the [`Scrollable`] with the given [`Id`] +/// Produces a [`Task`] that scrolls the [`Scrollable`] with the given [`widget::Id`] /// by the provided [`AbsoluteOffset`]. pub fn scroll_by( id: impl Into, diff --git a/widget/src/text_input.rs b/widget/src/text_input.rs index a40cd149..9d39e02c 100644 --- a/widget/src/text_input.rs +++ b/widget/src/text_input.rs @@ -156,7 +156,7 @@ where } } - /// Sets the [`Id`] of the [`TextInput`]. + /// Sets the [`widget::Id`] of the [`TextInput`]. pub fn id(mut self, id: impl Into) -> Self { self.id = Some(id.into()); self @@ -1445,17 +1445,17 @@ pub enum Side { Right, } -/// Produces a [`Task`] that returns whether the [`TextInput`] with the given [`Id`] is focused or not. +/// Produces a [`Task`] that returns whether the [`TextInput`] with the given [`widget::Id`] is focused or not. pub fn is_focused(id: impl Into) -> Task { task::widget(operation::focusable::is_focused(id.into())) } -/// Produces a [`Task`] that focuses the [`TextInput`] with the given [`Id`]. +/// Produces a [`Task`] that focuses the [`TextInput`] with the given [`widget::Id`]. pub fn focus(id: impl Into) -> Task { task::effect(Action::widget(operation::focusable::focus(id.into()))) } -/// Produces a [`Task`] that moves the cursor of the [`TextInput`] with the given [`Id`] to the +/// Produces a [`Task`] that moves the cursor of the [`TextInput`] with the given [`widget::Id`] to the /// end. pub fn move_cursor_to_end(id: impl Into) -> Task { task::effect(Action::widget(operation::text_input::move_cursor_to_end( @@ -1463,7 +1463,7 @@ pub fn move_cursor_to_end(id: impl Into) -> Task { ))) } -/// Produces a [`Task`] that moves the cursor of the [`TextInput`] with the given [`Id`] to the +/// Produces a [`Task`] that moves the cursor of the [`TextInput`] with the given [`widget::Id`] to the /// front. pub fn move_cursor_to_front(id: impl Into) -> Task { task::effect(Action::widget(operation::text_input::move_cursor_to_front( @@ -1471,7 +1471,7 @@ pub fn move_cursor_to_front(id: impl Into) -> Task { ))) } -/// Produces a [`Task`] that moves the cursor of the [`TextInput`] with the given [`Id`] to the +/// Produces a [`Task`] that moves the cursor of the [`TextInput`] with the given [`widget::Id`] to the /// provided position. pub fn move_cursor_to( id: impl Into, @@ -1483,7 +1483,7 @@ pub fn move_cursor_to( ))) } -/// Produces a [`Task`] that selects all the content of the [`TextInput`] with the given [`Id`]. +/// Produces a [`Task`] that selects all the content of the [`TextInput`] with the given [`widget::Id`]. pub fn select_all(id: impl Into) -> Task { task::effect(Action::widget(operation::text_input::select_all(id.into()))) }