Skip to content

Commit

Permalink
Docs tweaks and forgot a few #[must_use]
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrasnitski committed Jun 20, 2022
1 parent bb4aee8 commit c1c4768
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 13 deletions.
1 change: 1 addition & 0 deletions src/builder/add_member.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use crate::model::prelude::*;
///
/// [`GuildId::add_member`]: crate::model::id::GuildId::add_member
#[derive(Clone, Debug, Serialize)]
#[must_use]
pub struct AddMember {
#[cfg(feature = "http")]
#[serde(skip)]
Expand Down
6 changes: 2 additions & 4 deletions src/builder/create_channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,8 @@ impl CreateChannel {
/// # Errors
///
/// If the `cache` is enabled, returns a [`ModelError::InvalidPermissions`] if the current user
/// does not have permission to manage channels.
///
/// Otherwise will return [`Error::Http`] if the current user lacks permission, or if invalid
/// data was given.
/// does not have permission to manage channels. Otherwise returns [`Error::Http`], as well as
/// if invalid data was given.
///
/// [Manage Channels]: Permissions::MANAGE_CHANNELS
pub async fn execute(self, cache_http: impl CacheHttp) -> Result<GuildChannel> {
Expand Down
7 changes: 3 additions & 4 deletions src/builder/create_invite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ use crate::model::prelude::*;
/// [`GuildChannel::create_invite`]: crate::model::channel::GuildChannel::create_invite
/// [`RichInvite`]: crate::model::invite::RichInvite
#[derive(Clone, Debug, Serialize)]
#[must_use]
pub struct CreateInvite {
#[cfg(feature = "http")]
#[serde(skip)]
Expand Down Expand Up @@ -281,10 +282,8 @@ impl CreateInvite {
///
/// # Errors
///
/// If the `cache` is enabled, returns [`ModelError::InvalidPermissions`]
/// if the current user does not have permission to create invites.
///
/// Otherwise returns [`Error::Http`] if the current user lacks permission.
/// If the `cache` is enabled, returns [`ModelError::InvalidPermissions`] if the current user
/// does not have permission to create invites. Otherwise, returns [`Error::Http`].
///
/// [Create Instant Invite]: Permissions::CREATE_INSTANT_INVITE
#[cfg(feature = "http")]
Expand Down
4 changes: 1 addition & 3 deletions src/builder/create_scheduled_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,7 @@ impl CreateScheduledEvent {
/// # Errors
///
/// If the `cache` is enabled, returns a [`ModelError::InvalidPermissions`] if the current user
/// does not have permission to manage scheduled events.
///
/// Otherwise will return [`Error::Http`] if the current user does not have permission.
/// does not have permission to manage scheduled events. Otherwise, returns [`Error::Http`].
///
/// [Manage Events]: Permissions::MANAGE_EVENTS
#[cfg(feature = "http")]
Expand Down
2 changes: 1 addition & 1 deletion src/builder/create_sticker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl<'a> CreateSticker<'a> {
/// # Errors
///
/// If the `cache` is enabled, returns a [`ModelError::InvalidPermissions`] if the current user
/// lacks permission. Otherwise, returns [`Error::Http`] - see [`Self::execute`].
/// lacks permission. Otherwise, returns [`Error::Http`].
///
/// [Manage Emojis and Stickers]: crate::model::permissions::Permissions::MANAGE_EMOJIS_AND_STICKERS
#[cfg(feature = "http")]
Expand Down
2 changes: 1 addition & 1 deletion src/model/guild/guild_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ use crate::model::prelude::*;

#[cfg(feature = "model")]
impl GuildId {
/// Returns a request builder that adds on execution will add a [`User`] to this guild with a
/// Returns a request builder that, when executed, will add a [`User`] to this guild with a
/// valid OAuth2 access token.
#[inline]
pub fn add_member(self, user_id: impl Into<UserId>) -> AddMember {
Expand Down

0 comments on commit c1c4768

Please sign in to comment.