fix typos (#50)
This commit is contained in:
@@ -457,7 +457,7 @@ impl Subscriber {
|
|||||||
self.subscribed_channels.retain(|c| *channel != &c[..]);
|
self.subscribed_channels.retain(|c| *channel != &c[..]);
|
||||||
|
|
||||||
// Only a single channel should be removed from the
|
// Only a single channel should be removed from the
|
||||||
// liste of subscribed channels.
|
// list of subscribed channels.
|
||||||
if self.subscribed_channels.len() != len - 1 {
|
if self.subscribed_channels.len() != len - 1 {
|
||||||
return Err(response.to_error());
|
return Err(response.to_error());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ impl Set {
|
|||||||
Ok(Set { key, value, expire })
|
Ok(Set { key, value, expire })
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Apply the `Get` command to the specified `Db` instace.
|
/// Apply the `Get` command to the specified `Db` instance.
|
||||||
///
|
///
|
||||||
/// The response is written to `dst`. This is called by the server in order
|
/// The response is written to `dst`. This is called by the server in order
|
||||||
/// to execute a received command.
|
/// to execute a received command.
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ impl Connection {
|
|||||||
/// # Returns
|
/// # Returns
|
||||||
///
|
///
|
||||||
/// On success, the received frame is returned. If the `TcpStream`
|
/// On success, the received frame is returned. If the `TcpStream`
|
||||||
/// is closed in a way that doesn't break a frame in half, it retuns
|
/// is closed in a way that doesn't break a frame in half, it returns
|
||||||
/// `None`. Otherwise, an error is returned.
|
/// `None`. Otherwise, an error is returned.
|
||||||
pub(crate) async fn read_frame(&mut self) -> crate::Result<Option<Frame>> {
|
pub(crate) async fn read_frame(&mut self) -> crate::Result<Option<Frame>> {
|
||||||
use frame::Error::Incomplete;
|
use frame::Error::Incomplete;
|
||||||
@@ -98,7 +98,7 @@ impl Connection {
|
|||||||
// When `advance` is called on the read buffer, all of the
|
// When `advance` is called on the read buffer, all of the
|
||||||
// data up to `len` is discarded. The details of how this
|
// data up to `len` is discarded. The details of how this
|
||||||
// works is left to `BytesMut`. This is often done by moving
|
// works is left to `BytesMut`. This is often done by moving
|
||||||
// an internal cursor, but it may be done by reallocataing
|
// an internal cursor, but it may be done by reallocating
|
||||||
// and copying data.
|
// and copying data.
|
||||||
self.buffer.advance(len);
|
self.buffer.advance(len);
|
||||||
|
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ impl Drop for Db {
|
|||||||
//
|
//
|
||||||
// First, determine if this is the last `Db` instance. This is done by
|
// First, determine if this is the last `Db` instance. This is done by
|
||||||
// checking `strong_count`. The count will be 2. One for this `Db`
|
// checking `strong_count`. The count will be 2. One for this `Db`
|
||||||
// intance and one for the handle held by the background task.
|
// instance and one for the handle held by the background task.
|
||||||
if Arc::strong_count(&self.shared) == 2 {
|
if Arc::strong_count(&self.shared) == 2 {
|
||||||
// The background task must be signaled to shutdown. This is done by
|
// The background task must be signaled to shutdown. This is done by
|
||||||
// setting `State::shutdown` to `true` and signalling the task.
|
// setting `State::shutdown` to `true` and signalling the task.
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ pub const DEFAULT_PORT: &str = "6379";
|
|||||||
/// Error returned by most functions.
|
/// Error returned by most functions.
|
||||||
///
|
///
|
||||||
/// When writing a real application, one might want to consider a specialized
|
/// When writing a real application, one might want to consider a specialized
|
||||||
/// errror handling crate or defining an error type as an `enum` of causes.
|
/// error handling crate or defining an error type as an `enum` of causes.
|
||||||
/// However, for our example, using a boxed `std::error::Error` is sufficient.
|
/// However, for our example, using a boxed `std::error::Error` is sufficient.
|
||||||
///
|
///
|
||||||
/// For performance reasons, boxing is avoided in any hot path. For example, in
|
/// For performance reasons, boxing is avoided in any hot path. For example, in
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ struct Handler {
|
|||||||
/// connection until the peer disconnects **or** a shutdown notification is
|
/// connection until the peer disconnects **or** a shutdown notification is
|
||||||
/// received from `shutdown`. In the latter case, any in-flight work being
|
/// received from `shutdown`. In the latter case, any in-flight work being
|
||||||
/// processed for the peer is continued until it reaches a safe state, at
|
/// processed for the peer is continued until it reaches a safe state, at
|
||||||
/// which point the connction is terminated.
|
/// which point the connection is terminated.
|
||||||
shutdown: Shutdown,
|
shutdown: Shutdown,
|
||||||
|
|
||||||
/// Not used directly. Instead, when `Handler` is dropped...?
|
/// Not used directly. Instead, when `Handler` is dropped...?
|
||||||
@@ -380,7 +380,7 @@ impl Drop for Handler {
|
|||||||
// Doing so unblocks the listener if the max number of
|
// Doing so unblocks the listener if the max number of
|
||||||
// connections has been reached.
|
// connections has been reached.
|
||||||
//
|
//
|
||||||
// This is done in a `Drop` implementation in order to guaranatee that
|
// This is done in a `Drop` implementation in order to guarantee that
|
||||||
// the permit is added even if the task handling the connection panics.
|
// the permit is added even if the task handling the connection panics.
|
||||||
// If `add_permit` was called at the end of the `run` function and some
|
// If `add_permit` was called at the end of the `run` function and some
|
||||||
// bug causes a panic. The permit would never be returned to the
|
// bug causes a panic. The permit would never be returned to the
|
||||||
|
|||||||
Reference in New Issue
Block a user