Skip to content

Commit

Permalink
Documentation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
olegnn committed Nov 27, 2019
1 parent 632ee50 commit c21ea48
Show file tree
Hide file tree
Showing 19 changed files with 22 additions and 23 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -91,7 +91,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
```

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).

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tokio-util/src/codec/decoder.rs
Expand Up @@ -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.
///
Expand Down
4 changes: 2 additions & 2 deletions tokio/README.md
Expand Up @@ -101,7 +101,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
```

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).

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/fs/mod.rs
Expand Up @@ -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.
//!
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/io/poll_evented.rs
Expand Up @@ -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.
///
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/io/registration.rs
Expand Up @@ -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.
///
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/io/util/async_read_ext.rs
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tokio/src/lib.rs
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions tokio/src/net/mod.rs
Expand Up @@ -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)**

//!
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/net/tcp/stream.rs
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/park/thread.rs
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/runtime/mod.rs
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/sync/mpsc/chan.rs
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/task/blocking.rs
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/task/harness.rs
Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/task/spawn.rs
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/time/delay_queue.rs
Expand Up @@ -531,7 +531,7 @@ impl<T> DelayQueue<T> {
/// 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
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/time/driver/mod.rs
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/util/slab/tests/loom_slab.rs
Expand Up @@ -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));
});
Expand Down

0 comments on commit c21ea48

Please sign in to comment.