From 4c9ef8b31fbd7e25ddce806ccc9857bcfcd8fea5 Mon Sep 17 00:00:00 2001 From: avinassh Date: Thu, 21 May 2020 01:28:16 +0530 Subject: [PATCH] fix typos (#50) --- src/client.rs | 2 +- src/cmd/set.rs | 2 +- src/connection.rs | 4 ++-- src/db.rs | 2 +- src/lib.rs | 2 +- src/server.rs | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/client.rs b/src/client.rs index 290ac0a..7fbbfd4 100644 --- a/src/client.rs +++ b/src/client.rs @@ -457,7 +457,7 @@ impl Subscriber { self.subscribed_channels.retain(|c| *channel != &c[..]); // Only a single channel should be removed from the - // liste of subscribed channels. + // list of subscribed channels. if self.subscribed_channels.len() != len - 1 { return Err(response.to_error()); } diff --git a/src/cmd/set.rs b/src/cmd/set.rs index e18b57b..10595a5 100644 --- a/src/cmd/set.rs +++ b/src/cmd/set.rs @@ -105,7 +105,7 @@ impl Set { 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 /// to execute a received command. diff --git a/src/connection.rs b/src/connection.rs index 258f20c..c6ea322 100644 --- a/src/connection.rs +++ b/src/connection.rs @@ -54,7 +54,7 @@ impl Connection { /// # Returns /// /// 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. pub(crate) async fn read_frame(&mut self) -> crate::Result> { use frame::Error::Incomplete; @@ -98,7 +98,7 @@ impl Connection { // When `advance` is called on the read buffer, all of the // data up to `len` is discarded. The details of how this // 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. self.buffer.advance(len); diff --git a/src/db.rs b/src/db.rs index 102f288..b2d61a7 100644 --- a/src/db.rs +++ b/src/db.rs @@ -253,7 +253,7 @@ impl Drop for Db { // // 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` - // 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 { // The background task must be signaled to shutdown. This is done by // setting `State::shutdown` to `true` and signalling the task. diff --git a/src/lib.rs b/src/lib.rs index 32596ff..64342e7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -55,7 +55,7 @@ pub const DEFAULT_PORT: &str = "6379"; /// Error returned by most functions. /// /// 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. /// /// For performance reasons, boxing is avoided in any hot path. For example, in diff --git a/src/server.rs b/src/server.rs index 42c3ac2..5fc3838 100644 --- a/src/server.rs +++ b/src/server.rs @@ -98,7 +98,7 @@ struct Handler { /// connection until the peer disconnects **or** a shutdown notification is /// 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 - /// which point the connction is terminated. + /// which point the connection is terminated. shutdown: Shutdown, /// 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 // 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. // 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