From 2d60308aa4d3b2f4fd85aaa25c2bb92f237b466c Mon Sep 17 00:00:00 2001 From: Gavin-Niederman Date: Sun, 18 Feb 2024 20:50:24 -0800 Subject: [PATCH] docs: improve links in docs --- packages/pros-devices/src/adi/mod.rs | 2 +- packages/pros-devices/src/lib.rs | 4 +--- packages/pros-devices/src/screen.rs | 2 +- packages/pros-devices/src/smart/mod.rs | 4 ++-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/pros-devices/src/adi/mod.rs b/packages/pros-devices/src/adi/mod.rs index d3853f64..9012d496 100644 --- a/packages/pros-devices/src/adi/mod.rs +++ b/packages/pros-devices/src/adi/mod.rs @@ -49,7 +49,7 @@ impl AdiPort { /// /// Creating new `AdiPort`s is inherently unsafe due to the possibility of constructing /// more than one device on the same port index allowing multiple mutable references to - /// the same hardware device. Prefer using [`crate::peripherals::Peripherals`] to register devices if possible. + /// the same hardware device. Prefer using [`Peripherals`](crate::peripherals::Peripherals) to register devices if possible. pub const unsafe fn new(index: u8, expander_index: Option) -> Self { Self { index, diff --git a/packages/pros-devices/src/lib.rs b/packages/pros-devices/src/lib.rs index 06169c96..f4c7dfe0 100644 --- a/packages/pros-devices/src/lib.rs +++ b/packages/pros-devices/src/lib.rs @@ -25,6 +25,7 @@ pub mod adi; pub mod smart; pub mod battery; +pub mod color; pub mod competition; pub mod controller; pub mod peripherals; @@ -32,9 +33,6 @@ pub mod position; pub mod screen; pub mod usd; -//TODO: find a better place to put this -pub mod color; - pub use controller::Controller; pub use position::Position; pub use screen::Screen; diff --git a/packages/pros-devices/src/screen.rs b/packages/pros-devices/src/screen.rs index fc89c51d..25101b63 100644 --- a/packages/pros-devices/src/screen.rs +++ b/packages/pros-devices/src/screen.rs @@ -348,7 +348,7 @@ impl Screen { /// /// Creating new `Screen`s is inherently unsafe due to the possibility of constructing /// more than one screen at once allowing multiple mutable references to the same - /// hardware device. Prefer using [`crate::peripherals::Peripherals`] to register devices if possible. + /// hardware device. Prefer using [`Peripherals`](crate::peripherals::Peripherals) to register devices if possible. pub unsafe fn new() -> Self { Self { current_line: 0, diff --git a/packages/pros-devices/src/smart/mod.rs b/packages/pros-devices/src/smart/mod.rs index 158a2ae6..e45ae7cf 100644 --- a/packages/pros-devices/src/smart/mod.rs +++ b/packages/pros-devices/src/smart/mod.rs @@ -13,7 +13,7 @@ //! //! Most devices can be created with a `new` function that generally takes a port number along with other //! device-specific parameters. All sensors are thread safe, however sensors can only be safely constructed -//! using the [`crate::peripherals`] API. +//! using the [`peripherals`](crate::peripherals) API. //! //! In cases where PROS gives the option of a blocking or non-blocking API, //! the blocking API is used for a synchronous method and the non-blocking API is used to create a future. @@ -108,7 +108,7 @@ impl SmartPort { /// Creating new `SmartPort`s is inherently unsafe due to the possibility of constructing /// more than one device on the same port index allowing multiple mutable references to /// the same hardware device. This violates rust's borrow checked guarantees. Prefer using - /// [`crate::peripherals::Peripherals`] to register devices if possible. + /// [`Peripherals`](crate::peripherals::Peripherals) to register devices if possible. /// /// # Examples ///