From 9865d9ccd727a7f6c5c9a6094b87af0f6353831b Mon Sep 17 00:00:00 2001 From: Perry Fraser Date: Mon, 1 Oct 2018 16:38:07 -0400 Subject: [PATCH] A bunch of typo fixes (#404) --- src/builder/edit_guild.rs | 2 +- src/builder/edit_role.rs | 2 +- src/builder/execute_webhook.rs | 4 ++-- src/client/bridge/gateway/shard_runner_message.rs | 2 +- src/client/dispatch.rs | 2 +- src/client/event_handler.rs | 4 ++-- src/framework/standard/command.rs | 6 +++--- src/framework/standard/configuration.rs | 4 ++-- src/framework/standard/create_command.rs | 8 ++++---- src/framework/standard/create_help_command.rs | 6 +++--- src/framework/standard/help_commands.rs | 8 ++++---- src/framework/standard/mod.rs | 4 ++-- src/http/ratelimiting.rs | 4 ++-- src/http/raw.rs | 2 +- src/model/invite.rs | 4 ++-- src/model/permissions.rs | 2 +- src/model/user.rs | 2 +- src/voice/threading.rs | 2 +- 18 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/builder/edit_guild.rs b/src/builder/edit_guild.rs index ba87f0cd028..c9083a24844 100644 --- a/src/builder/edit_guild.rs +++ b/src/builder/edit_guild.rs @@ -93,7 +93,7 @@ impl EditGuild { /// Set the name of the guild. /// - /// **Note**: Must be between (and including) 2-100 chracters. + /// **Note**: Must be between (and including) 2-100 characters. pub fn name(mut self, name: &str) -> Self { self.0.insert("name", Value::String(name.to_string())); diff --git a/src/builder/edit_role.rs b/src/builder/edit_role.rs index 1deb57d1ec7..bf0b489fe7a 100644 --- a/src/builder/edit_role.rs +++ b/src/builder/edit_role.rs @@ -5,7 +5,7 @@ use model::{ }; use utils::VecMap; -/// A builer to create or edit a [`Role`] for use via a number of model methods. +/// A builder to create or edit a [`Role`] for use via a number of model methods. /// /// These are: /// diff --git a/src/builder/execute_webhook.rs b/src/builder/execute_webhook.rs index 65823bb4fb1..780d1022af4 100644 --- a/src/builder/execute_webhook.rs +++ b/src/builder/execute_webhook.rs @@ -143,7 +143,7 @@ impl ExecuteWebhook { /// /// # Examples /// - /// Overriuding the username to `"hakase"`: + /// Overriding the username to `"hakase"`: /// /// ```rust,no_run /// # use serenity::client::rest; @@ -173,7 +173,7 @@ impl Default for ExecuteWebhook { /// ```rust /// use serenity::builder::ExecuteWebhook; /// - /// let executer = ExecuteWebhook::default(); + /// let executor = ExecuteWebhook::default(); /// ``` /// /// [`Webhook`]: ../model/webhook/struct.Webhook.html diff --git a/src/client/bridge/gateway/shard_runner_message.rs b/src/client/bridge/gateway/shard_runner_message.rs index f281d218afa..edb9b8a9231 100644 --- a/src/client/bridge/gateway/shard_runner_message.rs +++ b/src/client/bridge/gateway/shard_runner_message.rs @@ -41,7 +41,7 @@ pub enum ShardRunnerMessage { /// Indicates that the client is to update the shard's presence's game. SetGame(Option), /// Indicates that the client is to update the shard's presence in its - /// entirity. + /// entirety. SetPresence(OnlineStatus, Option), /// Indicates that the client is to update the shard's presence's status. SetStatus(OnlineStatus), diff --git a/src/client/dispatch.rs b/src/client/dispatch.rs index 3e3bcfaf4c8..5f88c3487ec 100644 --- a/src/client/dispatch.rs +++ b/src/client/dispatch.rs @@ -167,7 +167,7 @@ fn handle_event( let context = context(data, runner_tx, shard_id); // Discord sends both a MessageCreate and a ChannelCreate upon a new message in a private channel. - // This could potentionally be annoying to handle when otherwise wanting to normally take care of a new channel. + // This could potentially be annoying to handle when otherwise wanting to normally take care of a new channel. // So therefore, private channels are dispatched to their own handler code. match event.channel { Channel::Private(channel) => { diff --git a/src/client/event_handler.rs b/src/client/event_handler.rs index 32fdaa11adc..426cddad170 100644 --- a/src/client/event_handler.rs +++ b/src/client/event_handler.rs @@ -217,12 +217,12 @@ pub trait EventHandler { /// Provides the reaction's data. fn reaction_add(&self, _ctx: Context, _add_reaction: Reaction) {} - /// Dispatched when a reaction is dettached from a message. + /// Dispatched when a reaction is detached from a message. /// /// Provides the reaction's data. fn reaction_remove(&self, _ctx: Context, _removed_reaction: Reaction) {} - /// Dispatched when all reactions of a message are dettached from a message. + /// Dispatched when all reactions of a message are detached from a message. /// /// Provides the channel's id and the message's id. fn reaction_remove_all(&self, _ctx: Context, _channel_id: ChannelId, _removed_from_message_id: MessageId) {} diff --git a/src/framework/standard/command.rs b/src/framework/standard/command.rs index 2b1149ea079..6f4440fe809 100644 --- a/src/framework/standard/command.rs +++ b/src/framework/standard/command.rs @@ -81,7 +81,7 @@ impl fmt::Debug for CommandOrAlias { #[derive(Clone, Debug)] pub struct Error(pub String); -// TODO: Have seperate `From<(&)String>` and `From<&str>` impls via specialization +// TODO: Have separate `From<(&)String>` and `From<&str>` impls via specialization impl From for Error { fn from(d: D) -> Self { Error(d.to_string()) @@ -141,7 +141,7 @@ pub struct CommandOptions { pub example: Option, /// Command usage schema, used by other commands. pub usage: Option, - /// Minumum amount of arguments that should be passed. + /// Minimum amount of arguments that should be passed. pub min_args: Option, /// Maximum amount of arguments that can be passed. pub max_args: Option, @@ -216,7 +216,7 @@ pub struct HelpOptions { pub wrong_channel: HelpBehaviour, /// Colour help-embed will use upon encountering an error. pub embed_error_colour: Colour, - /// Colour help-embed will use if no error occured. + /// Colour help-embed will use if no error occurred. pub embed_success_colour: Colour, /// If not 0, help will check whether a command is similar to searched named. pub max_levenshtein_distance: usize, diff --git a/src/framework/standard/configuration.rs b/src/framework/standard/configuration.rs index 795493d7ccc..c19b1dd2ee9 100644 --- a/src/framework/standard/configuration.rs +++ b/src/framework/standard/configuration.rs @@ -448,7 +448,7 @@ impl Configuration { /// /// # Examples /// - /// Have the args be seperated by a comma and a space: + /// Have the args be separated by a comma and a space: /// /// ```rust,no_run /// # use serenity::prelude::*; @@ -475,7 +475,7 @@ impl Configuration { /// /// # Examples /// - /// Have the args be seperated by a comma and a space; and a regular space: + /// Have the args be separated by a comma and a space; and a regular space: /// /// ```rust,no_run /// # use serenity::prelude::*; diff --git a/src/framework/standard/create_command.rs b/src/framework/standard/create_command.rs index a769d4cbd00..200f9f76428 100644 --- a/src/framework/standard/create_command.rs +++ b/src/framework/standard/create_command.rs @@ -189,7 +189,7 @@ impl CreateCommand { self } - /// Minumum amount of arguments that should be passed. + /// Minimum amount of arguments that should be passed. pub fn min_args(mut self, min_args: i32) -> Self { self.0.min_args = Some(min_args); @@ -236,7 +236,7 @@ impl CreateCommand { /// Sets an initialise middleware to be called upon the command's actual registration. /// - /// This is similiar to implementing the `init` function on `Command`. + /// This is similar to implementing the `init` function on `Command`. pub fn init(mut self, f: F) -> Self { self.2.init = Some(Arc::new(f)); @@ -245,7 +245,7 @@ impl CreateCommand { /// Sets a before middleware to be called before the command's execution. /// - /// This is similiar to implementing the `before` function on `Command`. + /// This is similar to implementing the `before` function on `Command`. pub fn before(mut self, f: F) -> Self where F: Fn(&mut Context, &Message) -> bool { self.2.before = Some(Arc::new(f)); @@ -255,7 +255,7 @@ impl CreateCommand { /// Sets an after middleware to be called after the command's execution. /// - /// This is similiar to implementing the `after` function on `Command`. + /// This is similar to implementing the `after` function on `Command`. pub fn after(mut self, f: F) -> Self where F: Fn(&mut Context, &Message, &Result<(), CommandError>) { self.2.after = Some(Arc::new(f)); diff --git a/src/framework/standard/create_help_command.rs b/src/framework/standard/create_help_command.rs index b8eb57a31eb..c05cb32d697 100644 --- a/src/framework/standard/create_help_command.rs +++ b/src/framework/standard/create_help_command.rs @@ -126,7 +126,7 @@ impl CreateHelpCommand { self } - /// Sets how the group-prexix shall be labeled. + /// Sets how the group-prefix shall be labeled. pub fn group_prefix(mut self, text: &str) -> Self { self.0.group_prefix = text.to_string(); @@ -204,14 +204,14 @@ impl CreateHelpCommand { self } - /// Sets the colour for the embed if no error occured. + /// Sets the colour for the embed if no error occurred. pub fn embed_success_colour(mut self, colour: Colour) -> Self { self.0.embed_success_colour = colour; self } - /// Sets the colour for the embed if an error occured. + /// Sets the colour for the embed if an error occurred. pub fn embed_error_colour(mut self, colour: Colour) -> Self { self.0.embed_error_colour = colour; diff --git a/src/framework/standard/help_commands.rs b/src/framework/standard/help_commands.rs index 94f49e96efe..94c9127527b 100644 --- a/src/framework/standard/help_commands.rs +++ b/src/framework/standard/help_commands.rs @@ -112,8 +112,8 @@ impl Suggestions { &self.0 } - /// Concats names of suggestions with a given `seperator`. - fn join(&self, seperator: &str) -> String { + /// Concats names of suggestions with a given `separator`. + fn join(&self, separator: &str) -> String { let mut iter = self.as_vec().iter(); let first_iter_element = match iter.next() { @@ -122,12 +122,12 @@ impl Suggestions { }; let size = self.as_vec().iter().fold(0, |total_size, size| total_size + size.name.len()); - let byte_len_of_sep = self.as_vec().len().checked_sub(1).unwrap_or(0) * seperator.len(); + let byte_len_of_sep = self.as_vec().len().checked_sub(1).unwrap_or(0) * separator.len(); let mut result = String::with_capacity(size + byte_len_of_sep); result.push_str(first_iter_element.name.borrow()); for element in iter { - result.push_str(&*seperator); + result.push_str(&*separator); result.push_str(element.name.borrow()); } diff --git a/src/framework/standard/mod.rs b/src/framework/standard/mod.rs index aa32d116be7..7e99a0f2fdd 100644 --- a/src/framework/standard/mod.rs +++ b/src/framework/standard/mod.rs @@ -951,7 +951,7 @@ impl StandardFramework { /// Sets what code should be executed when a user sends `(prefix)help`. /// - /// If a command named `help` was set with [`command`], then this takes precendence first. + /// If a command named `help` was set with [`command`], then this takes precedence first. /// /// [`command`]: #method.command pub fn help(mut self, f: HelpFunction) -> Self { @@ -1238,7 +1238,7 @@ pub fn has_correct_roles(cmd: &Arc, guild: &Guild, member: &Memb /// The command can't be used in the current channel (as in `DM only` or `guild only`). #[derive(PartialEq, Debug)] pub enum HelpBehaviour { - /// Strikes a command by applying `~~{comand_name}~~`. + /// Strikes a command by applying `~~{command_name}~~`. Strike, /// Does not list a command in the help-menu. Hide, diff --git a/src/http/ratelimiting.rs b/src/http/ratelimiting.rs index 5edb6ee7788..7713b27cd7e 100644 --- a/src/http/ratelimiting.rs +++ b/src/http/ratelimiting.rs @@ -68,7 +68,7 @@ lazy_static! { /// prior to every request, to abide by Discord's global ratelimit. /// /// The global ratelimit is the total number of requests that may be made - /// across the entirity of the API within an amount of time. If this is + /// across the entirety of the API within an amount of time. If this is /// reached, then the global mutex is unlocked for the amount of time /// present in the "Retry-After" header. /// @@ -82,7 +82,7 @@ lazy_static! { /// The routes mutex is a HashMap of each [`Route`] and their respective /// ratelimit information. /// - /// See the documentation for [`RateLimit`] for more infomation on how the + /// See the documentation for [`RateLimit`] for more information on how the /// library handles ratelimiting. /// /// # Examples diff --git a/src/http/raw.rs b/src/http/raw.rs index f4b4cf0c379..b4a9cc97952 100644 --- a/src/http/raw.rs +++ b/src/http/raw.rs @@ -413,7 +413,7 @@ pub fn delete_guild(guild_id: u64) -> Result { }) } -/// Remvoes an integration from a guild. +/// Removes an integration from a guild. pub fn delete_guild_integration(guild_id: u64, integration_id: u64) -> Result<()> { wind(204, Request { body: None, diff --git a/src/model/invite.rs b/src/model/invite.rs index a6aa7565696..b391f9b676c 100644 --- a/src/model/invite.rs +++ b/src/model/invite.rs @@ -162,7 +162,7 @@ impl Invite { pub fn url(&self) -> String { format!("https://discord.gg/{}", self.code) } } -/// A inimal information about the channel an invite points to. +/// A minimal information about the channel an invite points to. #[derive(Clone, Debug, Deserialize, Serialize)] pub struct InviteChannel { pub id: ChannelId, @@ -253,7 +253,7 @@ pub struct RichInvite { pub max_age: u64, /// The maximum number of times that an invite may be used before it expires. - /// Note that this does not supercede the [`max_age`] value, if the value of + /// Note that this does not supersede the [`max_age`] value, if the value of /// [`temporary`] is `true`. If the value of `temporary` is `false`, then the /// invite _will_ self-expire after the given number of max uses. diff --git a/src/model/permissions.rs b/src/model/permissions.rs index 784071e786c..b3184168f3f 100644 --- a/src/model/permissions.rs +++ b/src/model/permissions.rs @@ -9,7 +9,7 @@ //! presets are available. These are [`PRESET_GENERAL`], [`PRESET_TEXT`], and //! [`PRESET_VOICE`]. //! -//! Permissions follow a heirarchy: +//! Permissions follow a hierarchy: //! //! - An account can grant roles to users that are of a lower position than //! its highest role; diff --git a/src/model/user.rs b/src/model/user.rs index 694f0989f73..1e90cb43922 100644 --- a/src/model/user.rs +++ b/src/model/user.rs @@ -612,7 +612,7 @@ impl User { /// /// # Examples /// - /// If maintaing a very long-running bot, you may want to periodically + /// If maintaining a very long-running bot, you may want to periodically /// refresh information about certain users if the state becomes /// out-of-sync: /// diff --git a/src/voice/threading.rs b/src/voice/threading.rs index 1e826a4f93c..55e3651e865 100644 --- a/src/voice/threading.rs +++ b/src/voice/threading.rs @@ -54,7 +54,7 @@ fn runner(rx: &MpscReceiver) { senders.push(s); }, Err(TryRecvError::Empty) => { - // If we receieved nothing, then we can perform an update. + // If we received nothing, then we can perform an update. break; }, Err(TryRecvError::Disconnected) => {