From f3e340a35b306e926e78537a0dd65b2e9b9cdc89 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 25 Jul 2022 03:26:01 -0400 Subject: [PATCH] chore: fix spelling mistakes (#4858) Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- .github/workflows/stress-test.yml | 2 +- CONTRIBUTING.md | 2 +- SECURITY.md | 8 ++++---- tokio-test/src/macros.rs | 2 +- .../src/sync/cancellation_token/tree_node.rs | 4 ++-- .../src/sync/tests/loom_cancellation_token.rs | 2 +- tokio-util/src/time/delay_queue.rs | 2 +- tokio-util/tests/framed_write.rs | 2 +- tokio-util/tests/sync_cancellation_token.rs | 14 +++++++------- tokio/docs/reactor-refactor.md | 6 +++--- tokio/src/coop.rs | 2 +- tokio/src/runtime/builder.rs | 2 +- tokio/src/runtime/metrics/runtime.rs | 2 +- tokio/src/runtime/task/mod.rs | 2 +- tokio/src/runtime/task/waker.rs | 2 +- tokio/src/sync/watch.rs | 2 +- tokio/src/task/consume_budget.rs | 2 +- tokio/src/task/local.rs | 4 ++-- tokio/src/time/driver/entry.rs | 2 +- tokio/src/time/driver/tests/mod.rs | 8 ++++---- tokio/src/time/interval.rs | 2 +- tokio/tests/macros_join.rs | 2 +- tokio/tests/macros_try_join.rs | 2 +- tokio/tests/rt_common.rs | 2 +- tokio/tests/sync_semaphore.rs | 2 +- tokio/tests/sync_semaphore_owned.rs | 2 +- 26 files changed, 42 insertions(+), 42 deletions(-) diff --git a/.github/workflows/stress-test.yml b/.github/workflows/stress-test.yml index bcbede18efd..e34e0d54907 100644 --- a/.github/workflows/stress-test.yml +++ b/.github/workflows/stress-test.yml @@ -12,7 +12,7 @@ env: rust_stable: stable jobs: - stess-test: + stress-test: name: Stress Test runs-on: ubuntu-latest strategy: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f7e7585742b..e25a51cde86 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -562,7 +562,7 @@ Tokio ≥1.0.0 comes with LTS guarantees: The goal of these guarantees is to provide stability to the ecosystem. -## Mininum Supported Rust Version (MSRV) +## Minimum Supported Rust Version (MSRV) * All Tokio ≥1.0.0 releases will support at least a 6-month old Rust compiler release. diff --git a/SECURITY.md b/SECURITY.md index bf155ff9e2f..75c2c4d3ce7 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,13 +1,13 @@ ## Report a security issue -The Tokio project team welcomes security reports and is committed to providing prompt attention to security issues. Security issues should be reported privately via [security@tokio.rs](mailto:security@tokio.rs). Security issues should not be reported via the public Github Issue tracker. +The Tokio project team welcomes security reports and is committed to providing prompt attention to security issues. Security issues should be reported privately via [security@tokio.rs](mailto:security@tokio.rs). Security issues should not be reported via the public GitHub Issue tracker. ## Vulnerability coordination -Remediation of security vulnerabilities is prioritized by the project team. The project team coordinates remediation with third-party project stakeholders via [Github Security Advisories](https://help.github.com/en/github/managing-security-vulnerabilities/about-github-security-advisories). Third-party stakeholders may include the reporter of the issue, affected direct or indirect users of Tokio, and maintainers of upstream dependencies if applicable. +Remediation of security vulnerabilities is prioritized by the project team. The project team coordinates remediation with third-party project stakeholders via [GitHub Security Advisories](https://help.github.com/en/github/managing-security-vulnerabilities/about-github-security-advisories). Third-party stakeholders may include the reporter of the issue, affected direct or indirect users of Tokio, and maintainers of upstream dependencies if applicable. -Downstream project maintainers and Tokio users can request participation in coordination of applicable security issues by sending your contact email address, Github username(s) and any other salient information to [security@tokio.rs](mailto:security@tokio.rs). Participation in security issue coordination processes is at the discretion of the Tokio team. +Downstream project maintainers and Tokio users can request participation in coordination of applicable security issues by sending your contact email address, GitHub username(s) and any other salient information to [security@tokio.rs](mailto:security@tokio.rs). Participation in security issue coordination processes is at the discretion of the Tokio team. ## Security advisories -The project team is committed to transparency in the security issue disclosure process. The Tokio team announces security issues via [project Github Release notes](https://github.com/tokio-rs/tokio/releases) and the [RustSec advisory database](https://github.com/RustSec/advisory-db) (i.e. `cargo-audit`). +The project team is committed to transparency in the security issue disclosure process. The Tokio team announces security issues via [project GitHub Release notes](https://github.com/tokio-rs/tokio/releases) and the [RustSec advisory database](https://github.com/RustSec/advisory-db) (i.e. `cargo-audit`). diff --git a/tokio-test/src/macros.rs b/tokio-test/src/macros.rs index 7ca73451f4d..4c029c9e781 100644 --- a/tokio-test/src/macros.rs +++ b/tokio-test/src/macros.rs @@ -260,7 +260,7 @@ macro_rules! assert_err { }}; } -/// Asserts that an exact duration has elapsed since since the start instant ±1ms. +/// Asserts that an exact duration has elapsed since the start instant ±1ms. /// /// ```rust /// use tokio::time::{self, Instant}; diff --git a/tokio-util/src/sync/cancellation_token/tree_node.rs b/tokio-util/src/sync/cancellation_token/tree_node.rs index b6cd698e23d..8f97dee8de5 100644 --- a/tokio-util/src/sync/cancellation_token/tree_node.rs +++ b/tokio-util/src/sync/cancellation_token/tree_node.rs @@ -200,7 +200,7 @@ where /// `parent` MUST have been a parent of the node when they both got locked, /// otherwise there is a potential for a deadlock as invariant #2 would be violated. /// -/// To aquire the locks for node and parent, use [with_locked_node_and_parent]. +/// To acquire the locks for node and parent, use [with_locked_node_and_parent]. fn move_children_to_parent(node: &mut Inner, parent: &mut Inner) { // Pre-allocate in the parent, for performance parent.children.reserve(node.children.len()); @@ -218,7 +218,7 @@ fn move_children_to_parent(node: &mut Inner, parent: &mut Inner) { /// Removes a child from the parent. /// /// `parent` MUST be the parent of `node`. -/// To aquire the locks for node and parent, use [with_locked_node_and_parent]. +/// To acquire the locks for node and parent, use [with_locked_node_and_parent]. fn remove_child(parent: &mut Inner, mut node: MutexGuard<'_, Inner>) { // Query the position from where to remove a node let pos = node.parent_idx; diff --git a/tokio-util/src/sync/tests/loom_cancellation_token.rs b/tokio-util/src/sync/tests/loom_cancellation_token.rs index e9c9f3dd980..4007b5be8c5 100644 --- a/tokio-util/src/sync/tests/loom_cancellation_token.rs +++ b/tokio-util/src/sync/tests/loom_cancellation_token.rs @@ -80,7 +80,7 @@ fn drop_token_no_child() { } #[test] -fn drop_token_with_childs() { +fn drop_token_with_children() { loom::model(|| { let token1 = CancellationToken::new(); let child_token1 = token1.child_token(); diff --git a/tokio-util/src/time/delay_queue.rs b/tokio-util/src/time/delay_queue.rs index 07082b97793..f6a3c63a5b9 100644 --- a/tokio-util/src/time/delay_queue.rs +++ b/tokio-util/src/time/delay_queue.rs @@ -190,7 +190,7 @@ impl SlabStorage { let key_contained = self.key_map.contains_key(&key.into()); if key_contained { - // It's possible that a `compact` call creates capacitiy in `self.inner` in + // It's possible that a `compact` call creates capacity in `self.inner` in // such a way that a `self.inner.insert` call creates a `key` which was // previously given out during an `insert` call prior to the `compact` call. // If `key` is contained in `self.key_map`, we have encountered this exact situation, diff --git a/tokio-util/tests/framed_write.rs b/tokio-util/tests/framed_write.rs index 259d9b0c9f3..01d71b2b8b4 100644 --- a/tokio-util/tests/framed_write.rs +++ b/tokio-util/tests/framed_write.rs @@ -130,7 +130,7 @@ fn write_hits_backpressure() { _ => unreachable!(), } - // Push a new new chunk + // Push a new chunk mock.calls.push_back(Ok(b[..].to_vec())); } // 1 'wouldblock', 4 * 2KB buffers, 1 b-byte buffer diff --git a/tokio-util/tests/sync_cancellation_token.rs b/tokio-util/tests/sync_cancellation_token.rs index 28ba284b6c2..de8ecc77734 100644 --- a/tokio-util/tests/sync_cancellation_token.rs +++ b/tokio-util/tests/sync_cancellation_token.rs @@ -258,7 +258,7 @@ fn cancel_only_all_descendants() { let child2_token = token.child_token(); let grandchild_token = child1_token.child_token(); let grandchild2_token = child1_token.child_token(); - let grandgrandchild_token = grandchild_token.child_token(); + let great_grandchild_token = grandchild_token.child_token(); assert!(!parent_token.is_cancelled()); assert!(!token.is_cancelled()); @@ -267,7 +267,7 @@ fn cancel_only_all_descendants() { assert!(!child2_token.is_cancelled()); assert!(!grandchild_token.is_cancelled()); assert!(!grandchild2_token.is_cancelled()); - assert!(!grandgrandchild_token.is_cancelled()); + assert!(!great_grandchild_token.is_cancelled()); let parent_fut = parent_token.cancelled(); let fut = token.cancelled(); @@ -276,7 +276,7 @@ fn cancel_only_all_descendants() { let child2_fut = child2_token.cancelled(); let grandchild_fut = grandchild_token.cancelled(); let grandchild2_fut = grandchild2_token.cancelled(); - let grandgrandchild_fut = grandgrandchild_token.cancelled(); + let great_grandchild_fut = great_grandchild_token.cancelled(); pin!(parent_fut); pin!(fut); @@ -285,7 +285,7 @@ fn cancel_only_all_descendants() { pin!(child2_fut); pin!(grandchild_fut); pin!(grandchild2_fut); - pin!(grandgrandchild_fut); + pin!(great_grandchild_fut); assert_eq!( Poll::Pending, @@ -321,7 +321,7 @@ fn cancel_only_all_descendants() { ); assert_eq!( Poll::Pending, - grandgrandchild_fut + great_grandchild_fut .as_mut() .poll(&mut Context::from_waker(&waker)) ); @@ -339,7 +339,7 @@ fn cancel_only_all_descendants() { assert!(child2_token.is_cancelled()); assert!(grandchild_token.is_cancelled()); assert!(grandchild2_token.is_cancelled()); - assert!(grandgrandchild_token.is_cancelled()); + assert!(great_grandchild_token.is_cancelled()); assert_eq!( Poll::Ready(()), @@ -367,7 +367,7 @@ fn cancel_only_all_descendants() { ); assert_eq!( Poll::Ready(()), - grandgrandchild_fut + great_grandchild_fut .as_mut() .poll(&mut Context::from_waker(&waker)) ); diff --git a/tokio/docs/reactor-refactor.md b/tokio/docs/reactor-refactor.md index 1c9ace15a8f..3005afc0168 100644 --- a/tokio/docs/reactor-refactor.md +++ b/tokio/docs/reactor-refactor.md @@ -188,9 +188,9 @@ readiness, the driver's tick is packed into the atomic `usize`. The `ScheduledIo` readiness `AtomicUsize` is structured as: ``` -| reserved | generation | driver tick | readinesss | -|----------+------------+--------------+------------| -| 1 bit | 7 bits + 8 bits + 16 bits | +| reserved | generation | driver tick | readiness | +|----------+------------+--------------+-----------| +| 1 bit | 7 bits + 8 bits + 16 bits | ``` The `reserved` and `generation` components exist today. diff --git a/tokio/src/coop.rs b/tokio/src/coop.rs index eaedae9b1b2..1ed1d17aa9f 100644 --- a/tokio/src/coop.rs +++ b/tokio/src/coop.rs @@ -215,7 +215,7 @@ mod test { } #[test] - fn bugeting() { + fn budgeting() { use futures::future::poll_fn; use tokio_test::*; diff --git a/tokio/src/runtime/builder.rs b/tokio/src/runtime/builder.rs index 5ba7b7abfd3..fff1b3ad64b 100644 --- a/tokio/src/runtime/builder.rs +++ b/tokio/src/runtime/builder.rs @@ -738,7 +738,7 @@ impl Builder { /// * `UnhandledPanic::ShutdownRuntime` will force the runtime to /// shutdown immediately when a spawned task panics even if that /// task's `JoinHandle` has not been dropped. All other spawned tasks - /// will immediatetly terminate and further calls to + /// will immediately terminate and further calls to /// [`Runtime::block_on`] will panic. /// /// # Unstable diff --git a/tokio/src/runtime/metrics/runtime.rs b/tokio/src/runtime/metrics/runtime.rs index cb0edf52ad8..279d70a0e74 100644 --- a/tokio/src/runtime/metrics/runtime.rs +++ b/tokio/src/runtime/metrics/runtime.rs @@ -131,7 +131,7 @@ impl RuntimeMetrics { /// /// `worker` is the index of the worker being queried. The given value must /// be between 0 and `num_workers()`. The index uniquely identifies a single - /// worker and will continue to indentify the worker throughout the lifetime + /// worker and will continue to identify the worker throughout the lifetime /// of the runtime instance. /// /// # Panics diff --git a/tokio/src/runtime/task/mod.rs b/tokio/src/runtime/task/mod.rs index 56911a731c3..46aa62b14d1 100644 --- a/tokio/src/runtime/task/mod.rs +++ b/tokio/src/runtime/task/mod.rs @@ -369,7 +369,7 @@ cfg_rt_multi_thread! { } impl Task { - /// Pre-emptively cancels the task as part of the shutdown process. + /// Preemptively cancels the task as part of the shutdown process. pub(crate) fn shutdown(self) { let raw = self.raw; mem::forget(self); diff --git a/tokio/src/runtime/task/waker.rs b/tokio/src/runtime/task/waker.rs index 74a29f4a847..a434d5be481 100644 --- a/tokio/src/runtime/task/waker.rs +++ b/tokio/src/runtime/task/waker.rs @@ -13,7 +13,7 @@ pub(super) struct WakerRef<'a, S: 'static> { _p: PhantomData<(&'a Header, S)>, } -/// Returns a `WakerRef` which avoids having to pre-emptively increase the +/// Returns a `WakerRef` which avoids having to preemptively increase the /// refcount if there is no need to do so. pub(super) fn waker_ref(header: &NonNull
) -> WakerRef<'_, S> where diff --git a/tokio/src/sync/watch.rs b/tokio/src/sync/watch.rs index 6866964265c..d4aeb2ef0ec 100644 --- a/tokio/src/sync/watch.rs +++ b/tokio/src/sync/watch.rs @@ -665,7 +665,7 @@ impl Sender { /// /// The `modify` closure must return `true` if the value has actually /// been modified during the mutable borrow. It should only return `false` - /// if the value is guaranteed to be unnmodified despite the mutable + /// if the value is guaranteed to be unmodified despite the mutable /// borrow. /// /// Receivers are only notified if the closure returned `true`. If the diff --git a/tokio/src/task/consume_budget.rs b/tokio/src/task/consume_budget.rs index c8b2d7e5ceb..7c46444b7ea 100644 --- a/tokio/src/task/consume_budget.rs +++ b/tokio/src/task/consume_budget.rs @@ -4,7 +4,7 @@ use std::task::Poll; /// runtime *if* the task's coop budget was exhausted. /// /// The task will only yield if its entire coop budget has been exhausted. -/// This function can can be used in order to insert optional yield points into long +/// This function can be used in order to insert optional yield points into long /// computations that do not use Tokio resources like sockets or semaphores, /// without redundantly yielding to the runtime each time. /// diff --git a/tokio/src/task/local.rs b/tokio/src/task/local.rs index ac77a3571e2..a5bd1bb8835 100644 --- a/tokio/src/task/local.rs +++ b/tokio/src/task/local.rs @@ -160,7 +160,7 @@ cfg_rt! { /// tokio::task::spawn_local(run_task(new_task)); /// } /// // If the while loop returns, then all the LocalSpawner - /// // objects have have been dropped. + /// // objects have been dropped. /// }); /// /// // This will return once all senders are dropped and all @@ -652,7 +652,7 @@ cfg_unstable! { /// * `UnhandledPanic::ShutdownRuntime` will force the `LocalSet` to /// shutdown immediately when a spawned task panics even if that /// task's `JoinHandle` has not been dropped. All other spawned tasks - /// will immediatetly terminate and further calls to + /// will immediately terminate and further calls to /// [`LocalSet::block_on`] and [`LocalSet::run_until`] will panic. /// /// # Panics diff --git a/tokio/src/time/driver/entry.rs b/tokio/src/time/driver/entry.rs index eb33e9a2aa2..48856bf3223 100644 --- a/tokio/src/time/driver/entry.rs +++ b/tokio/src/time/driver/entry.rs @@ -36,7 +36,7 @@ //! point than it was originally scheduled for. //! //! This is accomplished by lazily rescheduling timers. That is, we update the -//! state field field with the true expiration of the timer from the holder of +//! state field with the true expiration of the timer from the holder of //! the [`TimerEntry`]. When the driver services timers (ie, whenever it's //! walking lists of timers), it checks this "true when" value, and reschedules //! based on it. diff --git a/tokio/src/time/driver/tests/mod.rs b/tokio/src/time/driver/tests/mod.rs index 005a2386ae3..fbe000f0f82 100644 --- a/tokio/src/time/driver/tests/mod.rs +++ b/tokio/src/time/driver/tests/mod.rs @@ -291,11 +291,11 @@ fn balanced_incr_and_decr() { let incr_inner = inner.clone(); let decr_inner = inner.clone(); - let incr_hndle = thread::spawn(move || incr(incr_inner)); - let decr_hndle = thread::spawn(move || decr(decr_inner)); + let incr_handle = thread::spawn(move || incr(incr_inner)); + let decr_handle = thread::spawn(move || decr(decr_inner)); - incr_hndle.join().expect("should never fail"); - decr_hndle.join().expect("should never fail"); + incr_handle.join().expect("should never fail"); + decr_handle.join().expect("should never fail"); assert_eq!(inner.num(Ordering::SeqCst), 0); }) diff --git a/tokio/src/time/interval.rs b/tokio/src/time/interval.rs index 0fe420fce8c..82c21709459 100644 --- a/tokio/src/time/interval.rs +++ b/tokio/src/time/interval.rs @@ -278,7 +278,7 @@ pub enum MissedTickBehavior { /// // 50ms after the call to `tick` up above. That is, in `tick`, when we /// // recognize that we missed a tick, we schedule the next tick to happen /// // 50ms (or whatever the `period` is) from right then, not from when - /// // were were *supposed* to tick + /// // were *supposed* to tick /// interval.tick().await; /// # } /// ``` diff --git a/tokio/tests/macros_join.rs b/tokio/tests/macros_join.rs index 17eba20efd9..b2969557f45 100644 --- a/tokio/tests/macros_join.rs +++ b/tokio/tests/macros_join.rs @@ -86,7 +86,7 @@ async fn non_cooperative_task(permits: Arc) -> usize { let mut exceeded_budget = 0; for _ in 0..5 { - // Another task should run after after this task uses its whole budget + // Another task should run after this task uses its whole budget for _ in 0..128 { let _permit = permits.clone().acquire_owned().await.unwrap(); } diff --git a/tokio/tests/macros_try_join.rs b/tokio/tests/macros_try_join.rs index c1bf6d3f16a..876de0b496a 100644 --- a/tokio/tests/macros_try_join.rs +++ b/tokio/tests/macros_try_join.rs @@ -114,7 +114,7 @@ async fn non_cooperative_task(permits: Arc) -> Result let mut exceeded_budget = 0; for _ in 0..5 { - // Another task should run after after this task uses its whole budget + // Another task should run after this task uses its whole budget for _ in 0..128 { let _permit = permits.clone().acquire_owned().await.unwrap(); } diff --git a/tokio/tests/rt_common.rs b/tokio/tests/rt_common.rs index da8dc6e3a09..7ff6ae3f120 100644 --- a/tokio/tests/rt_common.rs +++ b/tokio/tests/rt_common.rs @@ -1137,7 +1137,7 @@ rt_test! { let (spawned_tx, mut spawned_rx) = mpsc::unbounded_channel(); let mut tasks = vec![]; - // Spawn a bunch of tasks that ping ping between each other to + // Spawn a bunch of tasks that ping-pong between each other to // saturate the runtime. for _ in 0..NUM { let (tx1, mut rx1) = mpsc::unbounded_channel(); diff --git a/tokio/tests/sync_semaphore.rs b/tokio/tests/sync_semaphore.rs index 72b646539e3..fe5807c8e7e 100644 --- a/tokio/tests/sync_semaphore.rs +++ b/tokio/tests/sync_semaphore.rs @@ -65,7 +65,7 @@ fn forget() { #[tokio::test] #[cfg(feature = "full")] -async fn stresstest() { +async fn stress_test() { let sem = Arc::new(Semaphore::new(5)); let mut join_handles = Vec::new(); for _ in 0..1000 { diff --git a/tokio/tests/sync_semaphore_owned.rs b/tokio/tests/sync_semaphore_owned.rs index 5780c0e10eb..c01add3cacc 100644 --- a/tokio/tests/sync_semaphore_owned.rs +++ b/tokio/tests/sync_semaphore_owned.rs @@ -91,7 +91,7 @@ fn forget() { #[tokio::test] #[cfg(feature = "full")] -async fn stresstest() { +async fn stress_test() { let sem = Arc::new(Semaphore::new(5)); let mut join_handles = Vec::new(); for _ in 0..1000 {