From a8bbb1440553e9b4915d6e2b2fc7d2d1a7f99173 Mon Sep 17 00:00:00 2001 From: Michael Krasnitski <42564254+mkrasnitski@users.noreply.github.com> Date: Thu, 18 Aug 2022 06:45:53 -0400 Subject: [PATCH] Fix some documentation comments and typos (#2095) --- src/builder/create_components.rs | 6 +++--- src/builder/create_embed.rs | 2 +- src/builder/create_message.rs | 8 ++++---- src/builder/create_sticker.rs | 2 +- src/collector/event_collector.rs | 2 +- src/model/channel/guild_channel.rs | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/builder/create_components.rs b/src/builder/create_components.rs index 7c208b7f796..11fb77bd79f 100644 --- a/src/builder/create_components.rs +++ b/src/builder/create_components.rs @@ -129,7 +129,7 @@ impl Default for CreateButton { } impl CreateButton { - // Creates a primary button. Equivalent to [`Self::default`]. + /// Creates a primary button. Equivalent to [`Self::default`]. pub fn new() -> Self { Self::default() } @@ -193,8 +193,8 @@ pub struct CreateSelectMenu { } impl CreateSelectMenu { - // Creates a builder with given custom id (a developer-defined identifier), and a list of - // options, leaving all other fields empty. + /// Creates a builder with given custom id (a developer-defined identifier), and a list of + /// options, leaving all other fields empty. pub fn new(custom_id: impl Into, options: Vec) -> Self { Self { custom_id: custom_id.into(), diff --git a/src/builder/create_embed.rs b/src/builder/create_embed.rs index 380a07a3f83..80d4d34a846 100644 --- a/src/builder/create_embed.rs +++ b/src/builder/create_embed.rs @@ -408,7 +408,7 @@ pub struct CreateEmbedFooter { } impl CreateEmbedFooter { - // Creates a new footer object with the given text, leaving all other fields empty. + /// Creates a new footer object with the given text, leaving all other fields empty. pub fn new(text: impl Into) -> Self { Self { text: text.into(), diff --git a/src/builder/create_message.rs b/src/builder/create_message.rs index 4b1ca38b0ad..4e4e4d799ca 100644 --- a/src/builder/create_message.rs +++ b/src/builder/create_message.rs @@ -62,7 +62,7 @@ pub struct CreateMessage<'a> { #[serde(skip_serializing_if = "Option::is_none")] flags: Option, - // The following fields are handled seperately. + // The following fields are handled separately. #[serde(skip)] files: Vec>, #[serde(skip)] @@ -221,7 +221,7 @@ impl<'a> CreateMessage<'a> { /// Appends a file to the message. /// - /// **Note**: Requres the [Attach Files] permission. + /// **Note**: Requires the [Attach Files] permission. /// /// [Attach Files]: Permissions::ATTACH_FILES pub fn add_file>>(mut self, file: T) -> Self { @@ -231,7 +231,7 @@ impl<'a> CreateMessage<'a> { /// Appends a list of files to the message. /// - /// **Note**: Requres the [Attach Files] permission. + /// **Note**: Requires the [Attach Files] permission. /// /// [Attach Files]: Permissions::ATTACH_FILES pub fn add_files>, It: IntoIterator>( @@ -247,7 +247,7 @@ impl<'a> CreateMessage<'a> { /// Calling this multiple times will overwrite the file list. To append files, call /// [`Self::add_file`] or [`Self::add_files`] instead. /// - /// **Note**: Requres the [Attach Files] permission. + /// **Note**: Requires the [Attach Files] permission. /// /// [Attach Files]: Permissions::ATTACH_FILES pub fn files>, It: IntoIterator>( diff --git a/src/builder/create_sticker.rs b/src/builder/create_sticker.rs index 93236237fe2..0d5a4b0b454 100644 --- a/src/builder/create_sticker.rs +++ b/src/builder/create_sticker.rs @@ -86,7 +86,7 @@ impl<'a> CreateSticker<'a> { self } - /// The Discord name of a unicode emoji representing the sticker's expression. Replaces teh + /// The Discord name of a unicode emoji representing the sticker's expression. Replaces the /// current value as set in [`Self::new`]. /// /// **Note**: Must be between 2 and 200 characters long. diff --git a/src/collector/event_collector.rs b/src/collector/event_collector.rs index 571181a0b04..ecc96e6c26e 100644 --- a/src/collector/event_collector.rs +++ b/src/collector/event_collector.rs @@ -18,7 +18,7 @@ impl FilterTrait for Filter { /// Checks if the `event` passes set constraints. /// Constraints are optional, as it is possible to limit events to - /// be sent by a specific user or in a specifc guild. + /// be sent by a specific user or in a specific guild. fn is_passing_constraints(&self, event: &mut LazyArc<'_, Event>) -> bool { fn empty_or_any(slice: &[T], f: F) -> bool where diff --git a/src/model/channel/guild_channel.rs b/src/model/channel/guild_channel.rs index 47d2ca9cc55..ebc2bf61ceb 100644 --- a/src/model/channel/guild_channel.rs +++ b/src/model/channel/guild_channel.rs @@ -1114,7 +1114,7 @@ impl GuildChannel { } } - /// Returns a builder which can be awaited to obtain a mesage or stream of messages sent in this guild channel. + /// Returns a builder which can be awaited to obtain a message or stream of messages sent in this guild channel. #[cfg(feature = "collector")] pub fn reply_collector<'a>( &self,