aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-11-02 19:31:15 +0000
committerGitHub <[email protected]>2021-11-02 19:31:15 +0000
commit569ecd699d1d7f346359b482ad7435fb44ff388b (patch)
tree4934dc5bf4898d1a136862e92d7296c98c9df9bf
parent11b0a89b6a46a0d50a8b16d0607a672f9399e01a (diff)
parent3dd39e3d46eae91ccc0773f1ac5d31b6469c16e7 (diff)
Merge #467
467: docs: fix some `cargo doc` warnings r=lulf a=numero-744 There are still 3 warnings (below) ``` Documenting embassy v0.1.0 (embassy) warning: unresolved link to `channel` --> src/channel/mpsc.rs:241:22 | 241 | /// [`channel`]: channel | ^^^^^^^ no item named `channel` in scope | = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `Task::spawn` --> src/executor/raw/mod.rs:105:12 | 105 | /// with [`Task::spawn()`], which will fail if it is already spawned. | ^^^^^^^^^^^^^ no item named `Task` in scope warning: public documentation for `spawn` links to private item `Executor::spawn` --> src/executor/raw/mod.rs:156:17 | 156 | /// cause [`Executor::spawn()`] to return the error. | ^^^^^^^^^^^^^^^^^ this item is private | = note: `#[warn(rustdoc::private_intra_doc_links)]` on by default = note: this link will resolve properly if you pass `--document-private-items` warning: `embassy` (lib doc) generated 3 warnings ``` Co-authored-by: Côme ALLART <[email protected]>
-rw-r--r--embassy/src/blocking_mutex/mod.rs2
-rw-r--r--embassy/src/channel/mpsc.rs10
-rw-r--r--embassy/src/executor/spawner.rs4
3 files changed, 8 insertions, 8 deletions
diff --git a/embassy/src/blocking_mutex/mod.rs b/embassy/src/blocking_mutex/mod.rs
index 641a1ed93..8ada27cb3 100644
--- a/embassy/src/blocking_mutex/mod.rs
+++ b/embassy/src/blocking_mutex/mod.rs
@@ -7,7 +7,7 @@ use critical_section::CriticalSection;
7 7
8/// Any object implementing this trait guarantees exclusive access to the data contained 8/// Any object implementing this trait guarantees exclusive access to the data contained
9/// within the mutex for the duration of the lock. 9/// within the mutex for the duration of the lock.
10/// Adapted from https://github.com/rust-embedded/mutex-trait. 10/// Adapted from <https://github.com/rust-embedded/mutex-trait>.
11pub trait Mutex { 11pub trait Mutex {
12 /// Data protected by the mutex. 12 /// Data protected by the mutex.
13 type Data; 13 type Data;
diff --git a/embassy/src/channel/mpsc.rs b/embassy/src/channel/mpsc.rs
index 12d85a52d..04709cb90 100644
--- a/embassy/src/channel/mpsc.rs
+++ b/embassy/src/channel/mpsc.rs
@@ -35,7 +35,7 @@
35//! consumes the channel to completion, at which point the receiver can be 35//! consumes the channel to completion, at which point the receiver can be
36//! dropped. 36//! dropped.
37//! 37//!
38//! This channel and its associated types were derived from https://docs.rs/tokio/0.1.22/tokio/sync/mpsc/fn.channel.html 38//! This channel and its associated types were derived from <https://docs.rs/tokio/0.1.22/tokio/sync/mpsc/fn.channel.html>
39 39
40use core::cell::RefCell; 40use core::cell::RefCell;
41use core::fmt; 41use core::fmt;
@@ -259,8 +259,8 @@ where
259 /// [`Receiver`] is dropped, or when the [`Receiver::close`] method is 259 /// [`Receiver`] is dropped, or when the [`Receiver::close`] method is
260 /// called. 260 /// called.
261 /// 261 ///
262 /// [`Receiver`]: crate::sync::mpsc::Receiver 262 /// [`Receiver`]: Receiver
263 /// [`Receiver::close`]: crate::sync::mpsc::Receiver::close 263 /// [`Receiver::close`]: Receiver::close
264 pub fn is_closed(&self) -> bool { 264 pub fn is_closed(&self) -> bool {
265 self.channel.lock(|c| c.is_closed()) 265 self.channel.lock(|c| c.is_closed())
266 } 266 }
@@ -342,7 +342,7 @@ where
342 342
343/// An error returned from the [`try_recv`] method. 343/// An error returned from the [`try_recv`] method.
344/// 344///
345/// [`try_recv`]: super::Receiver::try_recv 345/// [`try_recv`]: Receiver::try_recv
346#[derive(PartialEq, Eq, Clone, Copy, Debug)] 346#[derive(PartialEq, Eq, Clone, Copy, Debug)]
347#[cfg_attr(feature = "defmt", derive(defmt::Format))] 347#[cfg_attr(feature = "defmt", derive(defmt::Format))]
348pub enum TryRecvError { 348pub enum TryRecvError {
@@ -371,7 +371,7 @@ impl<T> defmt::Format for SendError<T> {
371} 371}
372 372
373/// This enumeration is the list of the possible error outcomes for the 373/// This enumeration is the list of the possible error outcomes for the
374/// [try_send](super::Sender::try_send) method. 374/// [try_send](Sender::try_send) method.
375#[derive(Debug)] 375#[derive(Debug)]
376pub enum TrySendError<T> { 376pub enum TrySendError<T> {
377 /// The data could not be sent on the channel because the channel is 377 /// The data could not be sent on the channel because the channel is
diff --git a/embassy/src/executor/spawner.rs b/embassy/src/executor/spawner.rs
index f06ac8a63..ee0e60c2c 100644
--- a/embassy/src/executor/spawner.rs
+++ b/embassy/src/executor/spawner.rs
@@ -77,7 +77,7 @@ impl Spawner {
77 77
78 /// Spawn a task into an executor. 78 /// Spawn a task into an executor.
79 /// 79 ///
80 /// You obtain the `token` by calling a task function (i.e. one marked with `#[embassy::task]). 80 /// You obtain the `token` by calling a task function (i.e. one marked with `#[embassy::task]`).
81 pub fn spawn<F>(&self, token: SpawnToken<F>) -> Result<(), SpawnError> { 81 pub fn spawn<F>(&self, token: SpawnToken<F>) -> Result<(), SpawnError> {
82 let task = token.raw_task; 82 let task = token.raw_task;
83 mem::forget(token); 83 mem::forget(token);
@@ -129,7 +129,7 @@ unsafe impl Sync for SendSpawner {}
129impl SendSpawner { 129impl SendSpawner {
130 /// Spawn a task into an executor. 130 /// Spawn a task into an executor.
131 /// 131 ///
132 /// You obtain the `token` by calling a task function (i.e. one marked with `#[embassy::task]). 132 /// You obtain the `token` by calling a task function (i.e. one marked with `#[embassy::task]`).
133 pub fn spawn<F: Send>(&self, token: SpawnToken<F>) -> Result<(), SpawnError> { 133 pub fn spawn<F: Send>(&self, token: SpawnToken<F>) -> Result<(), SpawnError> {
134 let header = token.raw_task; 134 let header = token.raw_task;
135 mem::forget(token); 135 mem::forget(token);