Skip to content

Commit

Permalink
Spelling fixes (#571)
Browse files Browse the repository at this point in the history
* docs: fix spelling and whitespace errors
  • Loading branch information
mathstuf authored and tobz committed Aug 25, 2018
1 parent 7dc6404 commit 82c5baa
Show file tree
Hide file tree
Showing 28 changed files with 46 additions and 46 deletions.
2 changes: 1 addition & 1 deletion ci/tsan
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ race:crossbeam_epoch
race:crossbeam_deque*push
race:crossbeam_deque*steal

# This filters out expected data race in the treiber stack implementations.
# This filters out expected data race in the Treiber stack implementations.
# Treiber stacks are inherently racy. The pop operation will attempt to access
# the "next" pointer on the node it is attempting to pop. However, at this
# point it has not gained ownership of the node and another thread might beat
Expand Down
2 changes: 1 addition & 1 deletion examples/echo-udp.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! An UDP echo server that just sends back everything that it receives.
//!
//! If you're on unix you can test this out by in one terminal executing:
//! If you're on Unix you can test this out by in one terminal executing:
//!
//! cargo run --example echo-udp
//!
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ impl Runtime {
/// complete, and yielding its resolved result. Any tasks or timers which
/// the future spawns internally will be executed on the runtime.
///
/// This method should not be called from an asynchrounous context.
/// This method should not be called from an asynchronous context.
///
/// # Panics
///
Expand All @@ -370,7 +370,7 @@ impl Runtime {
/// its resolved result. Any tasks or timers which the future spawns
/// internally will be executed on the runtime and waited for completion.
///
/// This method should not be called from an asynchrounous context.
/// This method should not be called from an asynchronous context.
///
/// # Panics
///
Expand Down
4 changes: 2 additions & 2 deletions src/timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
//! is initialized with a `Duration` and repeatedly yields each time the
//! duration elapses.
//!
//! * [`Timeout`][Timeeout]: Wraps a future or stream, setting an upper bound to the
//! * [`Timeout`][Timeout]: Wraps a future or stream, setting an upper bound to the
//! amount of time it is allowed to execute. If the future or stream does not
//! completee in time, then it is canceled and an error is returned.
//! complete in time, then it is canceled and an error is returned.
//!
//! * [`DelayQueue`]: A queue where items are returned once the requested delay
//! has expired.
Expand Down
4 changes: 2 additions & 2 deletions tokio-current-thread/src/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ struct Inner<U> {
head_readiness: AtomicPtr<Node<U>>,
tail_readiness: UnsafeCell<*const Node<U>>,

// Used as part of the MPSC queue algorithm
// Used as part of the mpsc queue algorithm
stub: Arc<Node<U>>,
}

Expand Down Expand Up @@ -242,7 +242,7 @@ where U: Unpark,
// being released, another thread notified it, which
// resulted in it getting pushed into the mpsc channel.
//
// In this case, we just dec the ref count.
// In this case, we just decrement the ref count.
let node = ptr2arc(node);
assert!((*node.next_all.get()).is_null());
assert!((*node.prev_all.get()).is_null());
Expand Down
2 changes: 1 addition & 1 deletion tokio-current-thread/tests/current_thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ fn turn_has_polled() {
}

// Our own mock Park that is never really waiting and the only
// thing it does is to send, on request, something (once) to a onshot
// thing it does is to send, on request, something (once) to a oneshot
// channel
struct MyPark {
sender: Option<oneshot::Sender<()>>,
Expand Down
2 changes: 1 addition & 1 deletion tokio-executor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ executor, including:
* The [`Executor`] trait describes the API for spawning a future onto an
executor.

* [`enter`] marks that the the current thread is entering an execution
* [`enter`] marks that the current thread is entering an execution
context. This prevents a second executor from accidentally starting from
within the context of one that is already running.

Expand Down
6 changes: 3 additions & 3 deletions tokio-executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
//! * The [`Executor`] trait describes the API for spawning a future onto an
//! executor.
//!
//! * [`enter`] marks that the the current thread is entering an execution
//! * [`enter`] marks that the current thread is entering an execution
//! context. This prevents a second executor from accidentally starting from
//! within the context of one that is already running.
//!
Expand Down Expand Up @@ -114,7 +114,7 @@ pub trait Executor {
///
/// # Panics
///
/// Implementors are encouraged to avoid panics. However, a panic is
/// Implementers are encouraged to avoid panics. However, a panic is
/// permitted and the caller should check the implementation specific
/// documentation for more details on possible panics.
///
Expand Down Expand Up @@ -148,7 +148,7 @@ pub trait Executor {
///
/// # Panics
///
/// This function must not panic. Implementors must ensure that panics do
/// This function must not panic. Implementers must ensure that panics do
/// not happen.
///
/// # Examples
Expand Down
2 changes: 1 addition & 1 deletion tokio-io/src/_tokio_codec/decoder.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// For now, we need to keep the implmentation of Encoder in tokio_io.
// For now, we need to keep the implementation of Encoder in tokio_io.

pub use codec::Decoder;
2 changes: 1 addition & 1 deletion tokio-io/src/_tokio_codec/encoder.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// For now, we need to keep the implmentation of Encoder in tokio_io.
// For now, we need to keep the implementation of Encoder in tokio_io.

pub use codec::Encoder;
2 changes: 1 addition & 1 deletion tokio-io/src/async_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub trait AsyncRead: std_io::Read {
/// `prepare_uninitialized_buffer`.
///
/// This function isn't actually `unsafe` to call but `unsafe` to implement.
/// The implementor must ensure that either the whole `buf` has been zeroed
/// The implementer must ensure that either the whole `buf` has been zeroed
/// or `read_buf()` overwrites the buffer without reading it and returns
/// correct value.
///
Expand Down
2 changes: 1 addition & 1 deletion tokio-io/src/async_write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub trait AsyncWrite: std_io::Write {
/// appropriate. This method is the hook for such protocols to implement the
/// graceful shutdown logic.
///
/// This `shutdown` method is required by implementors of the
/// This `shutdown` method is required by implementers of the
/// `AsyncWrite` trait. Wrappers typically just want to proxy this call
/// through to the wrapped type, and base types will typically implement
/// shutdown logic here or just return `Ok(().into())`. Note that if you're
Expand Down
2 changes: 1 addition & 1 deletion tokio-io/src/framed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ impl<T, U> Framed<T, U> {
/// being worked with.
pub fn into_parts(self) -> FramedParts<T> {
let (inner, readbuf) = self.inner.into_parts();
let (inner, writebuf) = inner.into_parts();
let (inner, writebuf) = inner.into_parts();
FramedParts { inner: inner.0, readbuf: readbuf, writebuf: writebuf }
}

Expand Down
2 changes: 1 addition & 1 deletion tokio-tcp/src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl TcpStream {
///
/// This function will create a new TCP socket and attempt to connect it to
/// the `addr` provided. The returned future will be resolved once the
/// stream has successfully connected, or it wil return an error if one
/// stream has successfully connected, or it will return an error if one
/// occurs.
pub fn connect(addr: &SocketAddr) -> ConnectFuture {
use self::ConnectFutureState::*;
Expand Down
4 changes: 2 additions & 2 deletions tokio-threadpool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ extern crate log;
//
// ## Sleeping workers
//
// Sleeping workers are tracked using a [treiber stack]. This results in the
// Sleeping workers are tracked using a [Treiber stack]. This results in the
// thread that most recently went to sleep getting woken up first. When the pool
// is not under load, this helps threads shutdown faster.
//
Expand Down Expand Up @@ -137,7 +137,7 @@ extern crate log;
// Also, whenever a worker is woken up via a signal and it does find work, it,
// in turn, will try to wake up a new worker.
//
// [treiber stack]: https://en.wikipedia.org/wiki/Treiber_Stack
// [Treiber stack]: https://en.wikipedia.org/wiki/Treiber_Stack

pub mod park;

Expand Down
2 changes: 1 addition & 1 deletion tokio-threadpool/src/pool/backup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub(crate) struct Backup {
/// * If the thread is running
state: AtomicUsize,

/// Next entry in the treiber stack.
/// Next entry in the Treiber stack.
next_sleeper: UnsafeCell<BackupId>,

/// Used to put the thread to sleep
Expand Down
4 changes: 2 additions & 2 deletions tokio-threadpool/src/pool/backup_stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub(crate) const EMPTY: BackupId = BackupId(MAX_BACKUP);
/// Used to mark the stack as terminated
pub(crate) const TERMINATED: BackupId = BackupId(EMPTY.0 + 1);

/// How many bits the treiber ABA guard is offset by
/// How many bits the Treiber ABA guard is offset by
const ABA_GUARD_SHIFT: usize = 16;

#[cfg(target_pointer_width = "64")]
Expand Down Expand Up @@ -165,7 +165,7 @@ impl State {
fn set_head(&mut self, val: BackupId) {
let val = val.0;

// The ABA guard protects against the ABA problem w/ treiber stacks
// The ABA guard protects against the ABA problem w/ Treiber stacks
let aba_guard = ((self.0 >> ABA_GUARD_SHIFT) + 1) & ABA_GUARD_MASK;

self.0 = (aba_guard << ABA_GUARD_SHIFT) | val;
Expand Down
2 changes: 1 addition & 1 deletion tokio-threadpool/src/task/blocking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::thread;
/// Manages the state around entering a blocking section and tasks that are
/// queued pending the ability to block.
///
/// This is a hybrid counter and instrusive mpsc channel (like `Queue`).
/// This is a hybrid counter and intrusive mpsc channel (like `Queue`).
#[derive(Debug)]
pub(crate) struct Blocking {
/// Queue head.
Expand Down
4 changes: 2 additions & 2 deletions tokio-threadpool/src/worker/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ impl Worker {
}
}
Shutdown | Running => {
// To get here, the block above transitioned the tate to
// To get here, the block above transitioned the state to
// `Sleeping`. No other thread can concurrently
// transition to `Shutdown` or `Running`.
unreachable!();
Expand Down Expand Up @@ -805,7 +805,7 @@ impl Worker {
}
}
Shutdown | Running => {
// To get here, the block above transitioned the tate to
// To get here, the block above transitioned the state to
// `Sleeping`. No other thread can concurrently
// transition to `Shutdown` or `Running`.
unreachable!();
Expand Down
4 changes: 2 additions & 2 deletions tokio-threadpool/src/worker/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub(crate) const EMPTY: usize = MAX_WORKERS;
/// Used to mark the stack as terminated
pub(crate) const TERMINATED: usize = EMPTY + 1;

/// How many bits the treiber ABA guard is offset by
/// How many bits the Treiber ABA guard is offset by
const ABA_GUARD_SHIFT: usize = 16;

#[cfg(target_pointer_width = "64")]
Expand Down Expand Up @@ -215,7 +215,7 @@ impl State {

#[inline]
fn set_head(&mut self, val: usize) {
// The ABA guard protects against the ABA problem w/ treiber stacks
// The ABA guard protects against the ABA problem w/ Treiber stacks
let aba_guard = ((self.0 >> ABA_GUARD_SHIFT) + 1) & ABA_GUARD_MASK;

self.0 = (aba_guard << ABA_GUARD_SHIFT) | val;
Expand Down
2 changes: 1 addition & 1 deletion tokio-timer/src/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ mod imp {
mod imp {
use std::sync::Mutex;
use std::sync::atomic::Ordering;

#[derive(Debug)]
pub struct AtomicU64 {
inner: Mutex<u64>,
Expand Down
12 changes: 6 additions & 6 deletions tokio-timer/src/delay_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ struct Data<T> {
/// Next entry in the stack
next: Option<usize>,

/// Previous entry in the stac
/// Previous entry in the stack
prev: Option<usize>,
}

Expand Down Expand Up @@ -231,7 +231,7 @@ impl<T> DelayQueue<T> {
/// use tokio_timer::timer::Handle;
///
/// let handle = Handle::default();
/// let deplay_queue: DelayQueue<u32> = DelayQueue::with_capacity_and_handle(0, &handle);
/// let delay_queue: DelayQueue<u32> = DelayQueue::with_capacity_and_handle(0, &handle);
/// ```
pub fn with_capacity_and_handle(capacity: usize, handle: &Handle) -> DelayQueue<T> {
DelayQueue {
Expand Down Expand Up @@ -282,7 +282,7 @@ impl<T> DelayQueue<T> {
///
/// The return value represents the insertion and is used at an argument to
/// [`remove`] and [`reset`]. Note that [`Key`] is token and is reused once
/// `value` is removed from the queue eitheer by calling [`poll`] after
/// `value` is removed from the queue either by calling [`poll`] after
/// `when` is reached or by calling [`remove`]. At this point, the caller
/// must take care to not use the returned [`Key`] again as it may reference
/// a different item in the queue.
Expand Down Expand Up @@ -350,7 +350,7 @@ impl<T> DelayQueue<T> {
///
/// The return value represents the insertion and is used at an argument to
/// [`remove`] and [`reset`]. Note that [`Key`] is token and is reused once
/// `value` is removed from the queue eitheer by calling [`poll`] after
/// `value` is removed from the queue either by calling [`poll`] after
/// `when` is reached or by calling [`remove`]. At this point, the caller
/// must take care to not use the returned [`Key`] again as it may reference
/// a different item in the queue.
Expand Down Expand Up @@ -485,7 +485,7 @@ impl<T> DelayQueue<T> {
///
/// delay_queue.reset_at(&key, Instant::now() + Duration::from_secs(10));
///
/// // "foo"is now scheduledto be returned in 10 seconds
/// // "foo"is now scheduled to be returned in 10 seconds
/// # }
/// ```
pub fn reset_at(&mut self, key: &Key, when: Instant) {
Expand Down Expand Up @@ -541,7 +541,7 @@ impl<T> DelayQueue<T> {
///
/// delay_queue.reset(&key, Duration::from_secs(10));
///
/// // "foo"is now scheduledto be returned in 10 seconds
/// // "foo"is now scheduled to be returned in 10 seconds
/// # }
/// ```
pub fn reset(&mut self, key: &Key, timeout: Duration) {
Expand Down
2 changes: 1 addition & 1 deletion tokio-timer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//!
//! * [`Timeout`]: Wraps a future or stream, setting an upper bound to the
//! amount of time it is allowed to execute. If the future or stream does not
//! completee in time, then it is canceled and an error is returned.
//! complete in time, then it is canceled and an error is returned.
//!
//! * [`DelayQueue`]: A queue where items are returned once the requested delay
//! has expired.
Expand Down
6 changes: 3 additions & 3 deletions tokio-timer/src/wheel/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ where
///
/// # Arguments
///
/// * `when`: is the instant at which the the entry should be fired. It is
/// * `when`: is the instant at which the entry should be fired. It is
/// represented as the number of milliseconds since the creation
/// of the timing wheel.
///
Expand All @@ -98,9 +98,9 @@ where
///
/// `Err(Elapsed)` indicates that `when` represents an instant that has
/// already passed. In this case, the caller should fire the timeout
/// immediateely.
/// immediately.
///
/// `Err(Invalid)` indicates an invalid `when` argumeent as been supplied.
/// `Err(Invalid)` indicates an invalid `when` argument as been supplied.
pub fn insert(&mut self, when: u64, item: T::Owned, store: &mut T::Store)
-> Result<(), (T::Owned, InsertError)>
{
Expand Down
2 changes: 1 addition & 1 deletion tokio-tls/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ extern crate tokio_tls;
use tokio_tls::{TlsConnector, TlsAcceptor};
```

You can find few examples how to use this crate in examples directory (using TLS in
You can find few examples how to use this crate in examples directory (using TLS in
hyper server or client).

By default the `native-tls` crate currently uses the "platform appropriate"
Expand Down
2 changes: 1 addition & 1 deletion tokio-uds/src/datagram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl UnixDatagram {

/// Creates an unnamed pair of connected sockets.
///
/// This function will create a pair of interconnected unix sockets for
/// This function will create a pair of interconnected Unix sockets for
/// communicating back and forth between one another. Each socket will be
/// associated with the event loop whose handle is also provided.
pub fn pair() -> io::Result<(UnixDatagram, UnixDatagram)> {
Expand Down
2 changes: 1 addition & 1 deletion tokio-uds/src/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::os::unix::io::{AsRawFd, RawFd};
use std::os::unix::net::{self, SocketAddr};
use std::path::Path;

/// A Unix socket which can accept connections from other unix sockets.
/// A Unix socket which can accept connections from other Unix sockets.
pub struct UnixListener {
io: PollEvented<mio_uds::UnixListener>,
}
Expand Down
6 changes: 3 additions & 3 deletions tokio-uds/src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use std::os::unix::io::{AsRawFd, RawFd};
use std::os::unix::net::{self, SocketAddr};
use std::path::Path;

/// A structure representing a connected unix socket.
/// A structure representing a connected Unix socket.
///
/// This socket can be connected directly with `UnixStream::connect` or accepted
/// from a listener with `UnixListener::incoming`. Additionally, a pair of
Expand All @@ -43,7 +43,7 @@ enum State {
impl UnixStream {
/// Connects to the socket named by `path`.
///
/// This function will create a new unix socket and connect to the path
/// This function will create a new Unix socket and connect to the path
/// specified, associating the returned stream with the default event loop's
/// handle.
pub fn connect<P>(path: P) -> ConnectFuture
Expand Down Expand Up @@ -75,7 +75,7 @@ impl UnixStream {

/// Creates an unnamed pair of connected sockets.
///
/// This function will create a pair of interconnected unix sockets for
/// This function will create a pair of interconnected Unix sockets for
/// communicating back and forth between one another. Each socket will be
/// associated with the event loop whose handle is also provided.
pub fn pair() -> io::Result<(UnixStream, UnixStream)> {
Expand Down

0 comments on commit 82c5baa

Please sign in to comment.