From d49a6019bece80991f70c4d7ca8c50d0ccf11508 Mon Sep 17 00:00:00 2001 From: "Cliff L. Biffle" Date: Sat, 25 May 2024 17:54:40 -0700 Subject: [PATCH] Indent some comments as clippy has gotten picky. Apparently nightly Clippy has developed opinions about list item wrapping in markdown comments that don't match vim's behavior. --- clippy-all.sh | 2 +- extra/list/src/lib.rs | 14 +++++++------- extra/rwlock/src/lib.rs | 17 +++++++++-------- os/src/exec.rs | 14 +++++++------- os/src/lib.rs | 16 ++++++++-------- os/src/list.rs | 28 ++++++++++++++-------------- os/src/time.rs | 2 +- 7 files changed, 47 insertions(+), 46 deletions(-) diff --git a/clippy-all.sh b/clippy-all.sh index 9d34d05..7db8515 100755 --- a/clippy-all.sh +++ b/clippy-all.sh @@ -7,6 +7,6 @@ DIRS="os extra/* testsuite/stm32f4 testsuite/stm32g0 testsuite/stm32f3 examples/ for d in $DIRS; do echo "---- clipping in $d" pushd $d > /dev/null - cargo clippy -- --deny warnings + cargo ${TOOLCHAIN:=} clippy -- --deny warnings popd > /dev/null done diff --git a/extra/list/src/lib.rs b/extra/list/src/lib.rs index 410ed48..e4e213b 100644 --- a/extra/list/src/lib.rs +++ b/extra/list/src/lib.rs @@ -66,14 +66,14 @@ use pin_project::{pin_project, pinned_drop}; /// The list only supports the following operations: /// /// - [`join`][List::join], which produces a `Future` that will register a new -/// node on the list and resolve when it has been triggered by `wake_*`. +/// node on the list and resolve when it has been triggered by `wake_*`. /// /// - [`wake_head_if`][List::wake_head_if], which looks at the head node of the -/// list and triggers its owning `Future` if it passes a predicate, +/// list and triggers its owning `Future` if it passes a predicate, /// /// - And a handful of other wake-related operations that can be expressed in -/// terms of `wake_head_if`: [`wake_while`][List::wake_while], -/// [`wake_all`][List::wake_all], [`wake_one`][List::wake_one]. +/// terms of `wake_head_if`: [`wake_while`][List::wake_while], +/// [`wake_all`][List::wake_all], [`wake_one`][List::wake_one]. /// /// In particular, there is no way for the owner of the list to get direct /// access to any of the nodes in the list -- only act upon them by waking them. @@ -112,17 +112,17 @@ use pin_project::{pin_project, pinned_drop}; /// that data structure: /// /// - Inserting in a sorted list takes time linear in the size of the list -/// (`O(n)`). +/// (`O(n)`). /// /// - Inserting in an unsorted list takes constant time (`O(1)`). /// /// - Waking the head node takes constant time (`O(1)`). /// /// - Waking a series of nodes takes time linear in the length of that sequence -/// (`O(m)`). +/// (`O(m)`). /// /// - Detaching an arbitrary node (by dropping its owning `Future`) takes -/// constant time (`O(1)`). +/// constant time (`O(1)`). #[derive(Default)] pub struct List { /// Links to the head and tail of the list, if the list is non-empty, or diff --git a/extra/rwlock/src/lib.rs b/extra/rwlock/src/lib.rs index 9c59608..07e88aa 100644 --- a/extra/rwlock/src/lib.rs +++ b/extra/rwlock/src/lib.rs @@ -7,17 +7,18 @@ //! There's a small family of related types in this here crate: //! //! - [`RwLock`] contains some data of type `T` and allows either multiple -//! shared references, or one exclusive reference, but not both simultaneously. +//! shared references, or one exclusive reference, but not both +//! simultaneously. //! - [`SharedGuard`] represents a shared reference to the data guarded by a -//! `RwLock` and allows access to it (via `Deref`). +//! `RwLock` and allows access to it (via `Deref`). //! - [`ActionPermit`] represents an _exclusive_ reference to the data -//! guarded by a `RwLock`, but once you start doing something that can modify -//! the data, you can't `await`, to ensure that cancellation won't corrupt the -//! guarded data. +//! guarded by a `RwLock`, but once you start doing something that can modify +//! the data, you can't `await`, to ensure that cancellation won't corrupt the +//! guarded data. //! - [`ExclusiveGuard`] allows arbitrary exclusive access, even across -//! `await` points, but you have to promise the library that the data is -//! inherently cancel-safe (by using the [`lilos::util::CancelSafe`] marker -//! type). +//! `await` points, but you have to promise the library that the data is +//! inherently cancel-safe (by using the [`lilos::util::CancelSafe`] marker +//! type). //! //! See the docs on [`RwLock`] for more details. //! diff --git a/os/src/exec.rs b/os/src/exec.rs index 84f88ae..8fc08e5 100644 --- a/os/src/exec.rs +++ b/os/src/exec.rs @@ -22,12 +22,12 @@ //! special circumstances: //! //! - If you need faster interrupt response, consider allowing some interrupts -//! to preempt task code using [`run_tasks_with_preemption`]. +//! to preempt task code using [`run_tasks_with_preemption`]. //! - If you need code to run when no other tasks are ready -- which can be -//! useful for putting the CPU into a low power state, or toggling a pin to -//! signal CPU load on a logic analyzer -- see [`run_tasks_with_idle`] +//! useful for putting the CPU into a low power state, or toggling a pin to +//! signal CPU load on a logic analyzer -- see [`run_tasks_with_idle`] //! - Finally, if you want to turn on all the bells and whistles, you can use -//! [`run_tasks_with_preemption_and_idle`] which combines the previous two. +//! [`run_tasks_with_preemption_and_idle`] which combines the previous two. //! //! //! # Interrupts, wait, and notify @@ -718,11 +718,11 @@ impl Notify { /// The meaning of `cond` "passing" is defined by the [`TestResult`] trait. /// /// - In the easiest case, `cond` should return a `bool`. `until` will - /// resolve when `cond` returns `true`. + /// resolve when `cond` returns `true`. /// /// - For more interesting use cases, `cond` can also return an `Option`. - /// In this case, `until` will resolve when `cond` returns `Some(value)`, - /// producing `value`. + /// In this case, `until` will resolve when `cond` returns `Some(value)`, + /// producing `value`. /// /// # Cancellation /// diff --git a/os/src/lib.rs b/os/src/lib.rs index 02f11df..9254758 100644 --- a/os/src/lib.rs +++ b/os/src/lib.rs @@ -52,18 +52,18 @@ //! enabling/disabling portions of the system: //! //! - `systick` (on by default). Enables reliance on the ARM M-profile SysTick -//! timer for portable timekeeping. Disabling makes the executor smaller at the -//! cost of losing all `time` API. On platforms where the SysTick timer stops -//! during sleep, such as Nordic nRF52, you may want to disable this feature and -//! use a different timekeeping mechanism. +//! timer for portable timekeeping. Disabling makes the executor smaller at +//! the cost of losing all `time` API. On platforms where the SysTick timer +//! stops during sleep, such as Nordic nRF52, you may want to disable this +//! feature and use a different timekeeping mechanism. //! //! - `mutex` (on by default). Enables access to the [`mutex`] module for -//! blocking access to shared data. Leaving this feature enabled has no cost if -//! you're not actually using `mutex`. +//! blocking access to shared data. Leaving this feature enabled has no cost +//! if you're not actually using `mutex`. //! //! - `spsc` (on by default). Enables access to the [`spsc`] module for -//! single-producer single-consumer inter-task queues. Leaving this feature -//! enabled has no cost if you're not actually using `spsc`. +//! single-producer single-consumer inter-task queues. Leaving this feature +//! enabled has no cost if you're not actually using `spsc`. //! //! //! # Composition and dynamic behavior diff --git a/os/src/list.rs b/os/src/list.rs index 1c185af..d053f59 100644 --- a/os/src/list.rs +++ b/os/src/list.rs @@ -30,14 +30,14 @@ //! - Create a `List`. //! //! - To track a waiter in the list, create a `Node` and pass it -//! to [`List::insert_and_wait`]. The node will be inserted in timestamp order, -//! after any existing nodes with the same timestamp. Note that you must `await` -//! (or poll) the future produced by `insert_and_wait` for the node to actually -//! join the list in its proper place. +//! to [`List::insert_and_wait`]. The node will be inserted in timestamp +//! order, after any existing nodes with the same timestamp. Note that you +//! must `await` (or poll) the future produced by `insert_and_wait` for the +//! node to actually join the list in its proper place. //! //! - At some future point, wake all nodes in a timestamp range by using either -//! [`List::wake_while`] or, as a convenience for writing timers, -//! [`List::wake_thru`]. +//! [`List::wake_while`] or, as a convenience for writing timers, +//! [`List::wake_thru`]. //! //! //! # Using as a wait queue @@ -45,10 +45,10 @@ //! - Create a `List<()>`. //! //! - To track a waiter in the list, create a `Node<()>` and pass it to -//! [`List::insert_and_wait`]. The node will be inserted at the tail of the -//! list. Note that you must `await` (or poll) the future produced by -//! `insert_and_wait` for the node to actually join the list in its proper -//! place. +//! [`List::insert_and_wait`]. The node will be inserted at the tail of the +//! list. Note that you must `await` (or poll) the future produced by +//! `insert_and_wait` for the node to actually join the list in its proper +//! place. //! //! - To wake one waiter, use [`List::wake_one`]. //! @@ -192,12 +192,12 @@ use crate::util::{NotSendMarker, Captures}; /// We satisfy a narrow form of `UnsafeCell`'s safety contract: /// /// - This type is not `Sync` and can't be accessed from multiple threads. This -/// means at most once of its operations (below) is executing at a time. +/// means at most once of its operations (below) is executing at a time. /// /// - The operations will produce temporary references (both `&` and `&mut`) -/// into the `UnsafeCell`, but will only produce one such reference at a time, -/// and won't let it escape the function. This prevents aliasing in both -/// directions, and deallocation of data while a reference exists. +/// into the `UnsafeCell`, but will only produce one such reference at a time, +/// and won't let it escape the function. This prevents aliasing in both +/// directions, and deallocation of data while a reference exists. /// /// This puts us into the corner of `UnsafeCell`'s contract that, at the time of /// this writing, reads "explicitly declared legal for single-threaded code." diff --git a/os/src/time.rs b/os/src/time.rs index b5c23bc..d65e8b3 100644 --- a/os/src/time.rs +++ b/os/src/time.rs @@ -345,7 +345,7 @@ pub fn with_deadline(deadline: TickTime, code: F) -> impl Future