From c21ea482e055619dc641484a5b5ed22e274d725d Mon Sep 17 00:00:00 2001 From: Oleg Nosov Date: Wed, 27 Nov 2019 10:56:05 +0300 Subject: [PATCH] Documentation fixes --- README.md | 4 ++-- tokio-util/src/codec/decoder.rs | 2 +- tokio/README.md | 4 ++-- tokio/src/fs/mod.rs | 2 +- tokio/src/io/poll_evented.rs | 2 +- tokio/src/io/registration.rs | 2 +- tokio/src/io/util/async_read_ext.rs | 2 +- tokio/src/lib.rs | 4 ++-- tokio/src/net/mod.rs | 3 +-- tokio/src/net/tcp/stream.rs | 2 +- tokio/src/park/thread.rs | 2 +- tokio/src/runtime/mod.rs | 2 +- tokio/src/sync/mpsc/chan.rs | 2 +- tokio/src/task/blocking.rs | 2 +- tokio/src/task/harness.rs | 2 +- tokio/src/task/spawn.rs | 2 +- tokio/src/time/delay_queue.rs | 2 +- tokio/src/time/driver/mod.rs | 2 +- tokio/src/util/slab/tests/loom_slab.rs | 2 +- 19 files changed, 22 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 45cdcaf5bac..34c63ccb9b1 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ async fn main() -> Result<(), Box> { ``` More examples can be found [here](examples). Note that the `master` branch -is currently being updated to use `async` / `await`. The examples are +is currently being updated to use `async` / `await`. The examples are not fully ported. Examples for stable Tokio can be found [here](https://github.com/tokio-rs/tokio/tree/v0.1.x/tokio/examples). @@ -101,7 +101,7 @@ not fully ported. Examples for stable Tokio can be found First, see if the answer to your question can be found in the [Guides] or the [API documentation]. If the answer is not there, there is an active community in the [Tokio Discord server][chat]. We would be happy to try to answer your -question. Last, if that doesn't work, try opening an [issue] with the question. +question. Last, if that doesn't work, try opening an [issue] with the question. [Guides]: https://tokio.rs/docs/ [API documentation]: https://docs.rs/tokio/latest/tokio diff --git a/tokio-util/src/codec/decoder.rs b/tokio-util/src/codec/decoder.rs index dfe5f8ee1a8..3cdf2bd7ba8 100644 --- a/tokio-util/src/codec/decoder.rs +++ b/tokio-util/src/codec/decoder.rs @@ -38,7 +38,7 @@ pub trait Decoder { /// Attempts to decode a frame from the provided buffer of bytes. /// /// This method is called by `FramedRead` whenever bytes are ready to be - /// parsed. The provided buffer of bytes is what's been read so far, and + /// parsed. The provided buffer of bytes is what's been read so far, and /// this instance of `Decode` can determine whether an entire frame is in /// the buffer and is ready to be returned. /// diff --git a/tokio/README.md b/tokio/README.md index 73597acce99..34666045a71 100644 --- a/tokio/README.md +++ b/tokio/README.md @@ -101,7 +101,7 @@ async fn main() -> Result<(), Box> { ``` More examples can be found [here](../examples). Note that the `master` branch -is currently being updated to use `async` / `await`. The examples are +is currently being updated to use `async` / `await`. The examples are not fully ported. Examples for stable Tokio can be found [here](https://github.com/tokio-rs/tokio/tree/v0.1.x/tokio/examples). @@ -111,7 +111,7 @@ not fully ported. Examples for stable Tokio can be found First, see if the answer to your question can be found in the [Guides] or the [API documentation]. If the answer is not there, there is an active community in the [Tokio Discord server][chat]. We would be happy to try to answer your -question. Last, if that doesn't work, try opening an [issue] with the question. +question. Last, if that doesn't work, try opening an [issue] with the question. [Guides]: https://tokio.rs/docs/ [API documentation]: https://docs.rs/tokio/0.2 diff --git a/tokio/src/fs/mod.rs b/tokio/src/fs/mod.rs index 1ded892c93c..c462bf4b54e 100644 --- a/tokio/src/fs/mod.rs +++ b/tokio/src/fs/mod.rs @@ -18,7 +18,7 @@ //! Where possible, users should prefer the provided asynchronous-specific //! traits such as [`AsyncRead`], or methods returning a `Future` or `Poll` //! type. Adaptions also extend to traits like `std::io::Read` where methods -//! return `std::io::Result`. Be warned that these adapted methods may return +//! return `std::io::Result`. Be warned that these adapted methods may return //! `std::io::ErrorKind::WouldBlock` if a *worker* thread can not be converted //! to a *backup* thread immediately. //! diff --git a/tokio/src/io/poll_evented.rs b/tokio/src/io/poll_evented.rs index bbd60259d31..e1d0d74d6f6 100644 --- a/tokio/src/io/poll_evented.rs +++ b/tokio/src/io/poll_evented.rs @@ -27,7 +27,7 @@ cfg_io_driver! { /// **Note**: While `PollEvented` is `Sync` (if the underlying I/O type is /// `Sync`), the caller must ensure that there are at most two tasks that /// use a `PollEvented` instance concurrently. One for reading and one for - /// writing. While violating this requirement is "safe" from a Rust memory + /// writing. While violating this requirement is "safe" from a Rust memory /// model point of view, it will result in unexpected behavior in the form /// of lost notifications and tasks hanging. /// diff --git a/tokio/src/io/registration.rs b/tokio/src/io/registration.rs index e8f9794dc49..c7f3d2a0316 100644 --- a/tokio/src/io/registration.rs +++ b/tokio/src/io/registration.rs @@ -30,7 +30,7 @@ cfg_io_driver! { /// ## Platform-specific events /// /// `Registration` also allows receiving platform-specific `mio::Ready` - /// events. These events are included as part of the read readiness event + /// events. These events are included as part of the read readiness event /// stream. The write readiness event stream is only for `Ready::writable()` /// events. /// diff --git a/tokio/src/io/util/async_read_ext.rs b/tokio/src/io/util/async_read_ext.rs index fe1e646eee2..2688d9185cf 100644 --- a/tokio/src/io/util/async_read_ext.rs +++ b/tokio/src/io/util/async_read_ext.rs @@ -161,7 +161,7 @@ cfg_io_util! { /// /// If the operation encounters an "end of file" before completely /// filling the buffer, it returns an error of the kind - /// [`ErrorKind::UnexpectedEof`]. The contents of `buf` are unspecified + /// [`ErrorKind::UnexpectedEof`]. The contents of `buf` are unspecified /// in this case. /// /// If any other read error is encountered then the operation diff --git a/tokio/src/lib.rs b/tokio/src/lib.rs index dbe44c654ad..3b8e37bf454 100644 --- a/tokio/src/lib.rs +++ b/tokio/src/lib.rs @@ -116,13 +116,13 @@ //! Finally, Tokio provides a _runtime_ for executing asynchronous tasks. Most //! applications can use the [`#[tokio::main]`][main] macro to run their code on the //! Tokio runtime. In use-cases where manual control over the runtime is -//! required, the [`tokio::runtime`] module provides APIs for configuring and +//! required, the [`tokio::runtime`] module provides APIs for configuring and //! managing runtimes. //! //! Using the runtime requires the "rt-core" or "rt-threaded" feature flags, to //! enable the basic [single-threaded scheduler][rt-core] and the [thread-pool //! scheduler][rt-threaded], respectively. See the [`runtime` module -//! documentation][rt-features] for details. In addition, the "macros" feature +//! documentation][rt-features] for details. In addition, the "macros" feature //! flag enables the `#[tokio::main]` and `#[tokio::test]` attributes. //! //! [main]: attr.main.html diff --git a/tokio/src/net/mod.rs b/tokio/src/net/mod.rs index a7b98cdb3e4..2be8f34e796 100644 --- a/tokio/src/net/mod.rs +++ b/tokio/src/net/mod.rs @@ -11,7 +11,7 @@ //! * [`UdpSocket`] provides functionality for communication over UDP //! * [`UnixListener`] and [`UnixStream`] provide functionality for communication over a //! Unix Domain Stream Socket **(available on Unix only)** -//! * [`UnixDatagram`] and [`UnixDatagramFramed`] provide functionality for communication +//! * [`UnixDatagram`] provides functionality for communication //! over Unix Domain Datagram Socket **(available on Unix only)** //! @@ -21,7 +21,6 @@ //! [`UnixListener`]: struct.UnixListener.html //! [`UnixStream`]: struct.UnixStream.html //! [`UnixDatagram`]: struct.UnixDatagram.html -//! [`UnixDatagramFramed`]: struct.UnixDatagramFramed.html mod addr; pub use addr::ToSocketAddrs; diff --git a/tokio/src/net/tcp/stream.rs b/tokio/src/net/tcp/stream.rs index b961e363fe5..afda9eba599 100644 --- a/tokio/src/net/tcp/stream.rs +++ b/tokio/src/net/tcp/stream.rs @@ -543,7 +543,7 @@ impl TcpStream { /// /// This option controls the action taken when a stream has unsent messages /// and the stream is closed. If `SO_LINGER` is set, the system - /// shall block the process until it can transmit the data or until the + /// shall block the process until it can transmit the data or until the /// time expires. /// /// If `SO_LINGER` is not specified, and the stream is closed, the system diff --git a/tokio/src/park/thread.rs b/tokio/src/park/thread.rs index dc844871e11..2a8d65d5044 100644 --- a/tokio/src/park/thread.rs +++ b/tokio/src/park/thread.rs @@ -128,7 +128,7 @@ impl Inner { fn park_timeout(&self, dur: Duration) { // Like `park` above we have a fast path for an already-notified thread, - // and afterwards we start coordinating for a sleep. return quickly. + // and afterwards we start coordinating for a sleep. return quickly. if self .state .compare_exchange(NOTIFIED, EMPTY, SeqCst, SeqCst) diff --git a/tokio/src/runtime/mod.rs b/tokio/src/runtime/mod.rs index 7225ea8d393..45c2bd5e3eb 100644 --- a/tokio/src/runtime/mod.rs +++ b/tokio/src/runtime/mod.rs @@ -304,7 +304,7 @@ impl Runtime { /// [basic scheduler] is used instead. /// /// If the threaded cheduler is selected, it will not spawn - /// any worker threads until it needs to, i.e. tasks are scheduled to run. + /// any worker threads until it needs to, i.e. tasks are scheduled to run. /// /// Most applications will not need to call this function directly. Instead, /// they will use the [`#[tokio::main]` attribute][main]. When more complex diff --git a/tokio/src/sync/mpsc/chan.rs b/tokio/src/sync/mpsc/chan.rs index 4030e380198..2cf0d055df6 100644 --- a/tokio/src/sync/mpsc/chan.rs +++ b/tokio/src/sync/mpsc/chan.rs @@ -279,7 +279,7 @@ where // TODO: This check may not be required as it most // likely can only return `true` at this point. A // channel is closed when all tx handles are - // dropped. Dropping a tx handle releases memory, + // dropped. Dropping a tx handle releases memory, // which ensures that if dropping the tx handle is // visible, then all messages sent are also visible. assert!(self.inner.semaphore.is_idle()); diff --git a/tokio/src/task/blocking.rs b/tokio/src/task/blocking.rs index 1b79ee1749f..71fbbe72286 100644 --- a/tokio/src/task/blocking.rs +++ b/tokio/src/task/blocking.rs @@ -5,7 +5,7 @@ cfg_rt_threaded! { /// /// In general, issuing a blocking call or performing a lot of compute in a /// future without yielding is not okay, as it may prevent the executor from - /// driving other futures forward. If you run a closure through this method, + /// driving other futures forward. If you run a closure through this method, /// the current executor thread will relegate all its executor duties to another /// (possibly new) thread, and only then poll the task. Note that this requires /// additional synchronization. diff --git a/tokio/src/task/harness.rs b/tokio/src/task/harness.rs index 39ea2b5da7b..c02003db978 100644 --- a/tokio/src/task/harness.rs +++ b/tokio/src/task/harness.rs @@ -538,7 +538,7 @@ where } unsafe fn wake_join(&self) { - // LOOM: ensure we can make this call + // LOOM: ensure we can make this call self.trailer().waker.check(); self.trailer().waker.with_unchecked(|ptr| { (*(*ptr).as_ptr()) diff --git a/tokio/src/task/spawn.rs b/tokio/src/task/spawn.rs index 6fdff651a59..e0d19fd5a36 100644 --- a/tokio/src/task/spawn.rs +++ b/tokio/src/task/spawn.rs @@ -4,7 +4,7 @@ use crate::task::JoinHandle; use std::future::Future; /// Spawns a new asynchronous task, returning a -/// [`JoinHandle`](super::JoinHandle)] for it. +/// [`JoinHandle`](super::JoinHandle) for it. /// /// Spawning a task enables the task to execute concurrently to other tasks. The /// spawned task may execute on the current thread, or it may be sent to a diff --git a/tokio/src/time/delay_queue.rs b/tokio/src/time/delay_queue.rs index 1fd70625fa0..eb5000d2f96 100644 --- a/tokio/src/time/delay_queue.rs +++ b/tokio/src/time/delay_queue.rs @@ -531,7 +531,7 @@ impl DelayQueue { /// of an `Instant`. /// /// The item remains in the queue but the delay is set to expire after - /// `timeout`. If `timeout` is zero, then the item is immediately made + /// `timeout`. If `timeout` is zero, then the item is immediately made /// available to the caller. /// /// # Panics diff --git a/tokio/src/time/driver/mod.rs b/tokio/src/time/driver/mod.rs index f5c5c5c6cec..e3b4510111a 100644 --- a/tokio/src/time/driver/mod.rs +++ b/tokio/src/time/driver/mod.rs @@ -54,7 +54,7 @@ use std::{cmp, fmt}; /// instant, and processes each entry for that slot. When the timer reaches the /// end of the wheel, it starts again at the beginning. /// -/// The implementation maintains six wheels arranged in a set of levels. As the +/// The implementation maintains six wheels arranged in a set of levels. As the /// levels go up, the slots of the associated wheel represent larger intervals /// of time. At each level, the wheel has 64 slots. Each slot covers a range of /// time equal to the wheel at the lower level. At level zero, each slot diff --git a/tokio/src/util/slab/tests/loom_slab.rs b/tokio/src/util/slab/tests/loom_slab.rs index 8a96a736ed1..48e94f00341 100644 --- a/tokio/src/util/slab/tests/loom_slab.rs +++ b/tokio/src/util/slab/tests/loom_slab.rs @@ -102,7 +102,7 @@ fn remove_remote_and_reuse() { let value = get_val(&s, idx1); // We may or may not see the new value yet, depending on when - // this occurs, but we must either see the new value or `None`; + // this occurs, but we must either see the new value or `None`; // the old value has been removed! assert!(value == None || value == Some(3)); });