Skip to content

Commit

Permalink
A bunch of typo fixes (#404)
Browse files Browse the repository at this point in the history
  • Loading branch information
perryprog authored and zeyla committed Oct 1, 2018
1 parent 8e401f0 commit 9865d9c
Show file tree
Hide file tree
Showing 18 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion src/builder/edit_guild.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()));

Expand Down
2 changes: 1 addition & 1 deletion src/builder/edit_role.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
///
Expand Down
4 changes: 2 additions & 2 deletions src/builder/execute_webhook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ impl ExecuteWebhook {
///
/// # Examples
///
/// Overriuding the username to `"hakase"`:
/// Overriding the username to `"hakase"`:
///
/// ```rust,no_run
/// # use serenity::client::rest;
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/client/bridge/gateway/shard_runner_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub enum ShardRunnerMessage {
/// Indicates that the client is to update the shard's presence's game.
SetGame(Option<Game>),
/// Indicates that the client is to update the shard's presence in its
/// entirity.
/// entirety.
SetPresence(OnlineStatus, Option<Game>),
/// Indicates that the client is to update the shard's presence's status.
SetStatus(OnlineStatus),
Expand Down
2 changes: 1 addition & 1 deletion src/client/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ fn handle_event<H: EventHandler + Send + Sync + 'static>(
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) => {
Expand Down
4 changes: 2 additions & 2 deletions src/client/event_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
Expand Down
6 changes: 3 additions & 3 deletions src/framework/standard/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<D: fmt::Display> From<D> for Error {
fn from(d: D) -> Self {
Error(d.to_string())
Expand Down Expand Up @@ -141,7 +141,7 @@ pub struct CommandOptions {
pub example: Option<String>,
/// Command usage schema, used by other commands.
pub usage: Option<String>,
/// Minumum amount of arguments that should be passed.
/// Minimum amount of arguments that should be passed.
pub min_args: Option<i32>,
/// Maximum amount of arguments that can be passed.
pub max_args: Option<i32>,
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/framework/standard/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
Expand All @@ -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::*;
Expand Down
8 changes: 4 additions & 4 deletions src/framework/standard/create_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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<F: Fn() + Send + Sync + 'static>(mut self, f: F) -> Self {
self.2.init = Some(Arc::new(f));

Expand All @@ -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<F: Send + Sync + 'static>(mut self, f: F) -> Self
where F: Fn(&mut Context, &Message) -> bool {
self.2.before = Some(Arc::new(f));
Expand All @@ -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<F: Send + Sync + 'static>(mut self, f: F) -> Self
where F: Fn(&mut Context, &Message, &Result<(), CommandError>) {
self.2.after = Some(Arc::new(f));
Expand Down
6 changes: 3 additions & 3 deletions src/framework/standard/create_help_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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;

Expand Down
8 changes: 4 additions & 4 deletions src/framework/standard/help_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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());
}

Expand Down
4 changes: 2 additions & 2 deletions src/framework/standard/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -1238,7 +1238,7 @@ pub fn has_correct_roles(cmd: &Arc<CommandOptions>, 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,
Expand Down
4 changes: 2 additions & 2 deletions src/http/ratelimiting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/http/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ pub fn delete_guild(guild_id: u64) -> Result<PartialGuild> {
})
}

/// 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,
Expand Down
4 changes: 2 additions & 2 deletions src/model/invite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion src/model/permissions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/model/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
///
Expand Down
2 changes: 1 addition & 1 deletion src/voice/threading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fn runner(rx: &MpscReceiver<Status>) {
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) => {
Expand Down

0 comments on commit 9865d9c

Please sign in to comment.