From c5bfac66e5deb880b518976699922a1076a1d7e7 Mon Sep 17 00:00:00 2001 From: Dirk Stolle Date: Wed, 31 Jan 2024 22:27:53 +0100 Subject: [PATCH] Fix a few typos (#471) --- README.md | 2 +- examples/login.rs | 2 +- src/errors.rs | 2 +- src/gateway/handle.rs | 2 +- src/gateway/heartbeat.rs | 2 +- src/gateway/message.rs | 4 ++-- src/instance.rs | 2 +- src/lib.rs | 2 +- src/types/events/lazy_request.rs | 2 +- src/types/events/message.rs | 2 +- tests/common/mod.rs | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index f512f0a..6f37762 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ let login_schema = LoginSchema { password: "Correct-Horse-Battery-Staple".to_string(), ..Default::default() }; -// Each user connects to the Gateway. The Gateway connection lives on a seperate thread. Depending on +// Each user connects to the Gateway. The Gateway connection lives on a separate thread. Depending on // the runtime feature you choose, this can potentially take advantage of all of your computers' threads. let user = instance .login_account(login_schema) diff --git a/examples/login.rs b/examples/login.rs index 144030b..9054a20 100644 --- a/examples/login.rs +++ b/examples/login.rs @@ -13,7 +13,7 @@ async fn main() { password: "Correct-Horse-Battery-Staple".to_string(), ..Default::default() }; - // Each user connects to the Gateway. The Gateway connection lives on a seperate thread. Depending on + // Each user connects to the Gateway. The Gateway connection lives on a separate thread. Depending on // the runtime feature you choose, this can potentially take advantage of all of your computers' threads. let user = instance .login_account(login_schema) diff --git a/src/errors.rs b/src/errors.rs index c20ac64..e481648 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -17,7 +17,7 @@ custom_error! { /// Server did not respond. NoResponse = "Did not receive a response from the Server.", /// Reqwest returned an Error instead of a Response object. - RequestFailed{url:String, error: String} = "An error occured while trying to GET from {url}: {error}", + RequestFailed{url:String, error: String} = "An error occurred while trying to GET from {url}: {error}", /// Response received, however, it was not of the successful responses type. Used when no other, special case applies. ReceivedErrorCode{error_code: u16, error: String} = "Received the following error code while requesting from the route: {error_code}", /// Used when there is likely something wrong with the instance, the request was directed to. diff --git a/src/gateway/handle.rs b/src/gateway/handle.rs index bc64077..b155fb5 100644 --- a/src/gateway/handle.rs +++ b/src/gateway/handle.rs @@ -169,7 +169,7 @@ impl GatewayHandle { /// Closes the websocket connection and stops all gateway tasks; /// - /// Esentially pulls the plug on the gateway, leaving it possible to resume; + /// Essentially pulls the plug on the gateway, leaving it possible to resume; pub async fn close(&self) { self.kill_send.send(()).unwrap(); self.websocket_send.lock().await.close().await.unwrap(); diff --git a/src/gateway/heartbeat.rs b/src/gateway/heartbeat.rs index e6991f3..1d2f617 100644 --- a/src/gateway/heartbeat.rs +++ b/src/gateway/heartbeat.rs @@ -128,7 +128,7 @@ impl HeartbeatHandler { let send_result = websocket_tx.lock().await.send(msg.into()).await; if send_result.is_err() { // We couldn't send, the websocket is broken - warn!("GW: Couldnt send heartbeat, websocket seems broken"); + warn!("GW: Couldn't send heartbeat, websocket seems broken"); break; } diff --git a/src/gateway/message.rs b/src/gateway/message.rs index 2c12e48..77efa3f 100644 --- a/src/gateway/message.rs +++ b/src/gateway/message.rs @@ -2,14 +2,14 @@ use crate::types; use super::*; -/// Represents a messsage received from the gateway. This will be either a [types::GatewayReceivePayload], containing events, or a [GatewayError]. +/// Represents a message received from the gateway. This will be either a [types::GatewayReceivePayload], containing events, or a [GatewayError]. /// This struct is used internally when handling messages. #[derive(Clone, Debug)] pub struct GatewayMessage(pub String); impl GatewayMessage { /// Parses the message as an error; - /// Returns the error if succesfully parsed, None if the message isn't an error + /// Returns the error if successfully parsed, None if the message isn't an error pub fn error(&self) -> Option { // Some error strings have dots on the end, which we don't care about let processed_content = self.0.to_lowercase().replace('.', ""); diff --git a/src/instance.rs b/src/instance.rs index cd5f6b2..d160bfc 100644 --- a/src/instance.rs +++ b/src/instance.rs @@ -181,7 +181,7 @@ impl ChorusUser { /// Creates a new [ChorusUser] from existing data. /// /// # Notes - /// This isn't the prefered way to create a ChorusUser. + /// This isn't the preferred way to create a ChorusUser. /// See [Instance::login_account] and [Instance::register_account] instead. pub fn new( belongs_to: Shared, diff --git a/src/lib.rs b/src/lib.rs index 1bbeeef..2efa91e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -44,7 +44,7 @@ let login_schema = LoginSchema { password: "Correct-Horse-Battery-Staple".to_string(), ..Default::default() }; -// Each user connects to the Gateway. The Gateway connection lives on a seperate thread. Depending on +// Each user connects to the Gateway. The Gateway connection lives on a separate thread. Depending on // the runtime feature you choose, this can potentially take advantage of all of your computers' threads. let user = instance .login_account(login_schema) diff --git a/src/types/events/lazy_request.rs b/src/types/events/lazy_request.rs index fd53183..be2103c 100644 --- a/src/types/events/lazy_request.rs +++ b/src/types/events/lazy_request.rs @@ -11,7 +11,7 @@ use super::WebSocketEvent; /// /// Sent to the server to signify lazy loading of a guild; /// Sent by the official client when switching to a guild or channel; -/// After this, you should recieve message updates +/// After this, you should receive message updates /// /// See /// diff --git a/src/types/events/message.rs b/src/types/events/message.rs index fac083b..e93df58 100644 --- a/src/types/events/message.rs +++ b/src/types/events/message.rs @@ -131,7 +131,7 @@ impl WebSocketEvent for MessageReactionRemoveEmoji {} /// Not documented anywhere unofficially /// /// Apparently "Message ACK refers to marking a message as read for Discord's API." () -/// I suspect this is sent and recieved from the gateway to let clients on other devices know the user has read a message +/// I suspect this is sent and received from the gateway to let clients on other devices know the user has read a message /// /// {"t":"MESSAGE_ACK","s":3,"op":0,"d":{"version":52,"message_id":"1107236673638633472","last_viewed":null,"flags":null,"channel_id":"967363950217936897"}} pub struct MessageACK { diff --git a/tests/common/mod.rs b/tests/common/mod.rs index e18f92b..02fef4f 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -52,7 +52,7 @@ impl TestBundle { // Set up a test by creating an Instance and a User. Reduces Test boilerplate. pub(crate) async fn setup() -> TestBundle { let instance = Instance::new("http://localhost:3001/api").await.unwrap(); - // Requires the existance of the below user. + // Requires the existence of the below user. let reg = RegisterSchema { username: "integrationtestuser".into(), consent: true,