From 192f12d89283765c48ea8a49db64fbd459c3aec9 Mon Sep 17 00:00:00 2001 From: kozabrada123 <59031733+kozabrada123@users.noreply.github.com> Date: Mon, 10 Jul 2023 16:59:00 +0200 Subject: [PATCH] /* -> /// --- src/api/channels/messages.rs | 41 +++++++++++++++----------------- src/api/channels/reactions.rs | 4 +--- src/api/users/users.rs | 18 +++++++------- src/instance.rs | 6 ++--- src/types/entities/attachment.rs | 6 +---- 5 files changed, 31 insertions(+), 44 deletions(-) diff --git a/src/api/channels/messages.rs b/src/api/channels/messages.rs index dbffaa8..c46409f 100644 --- a/src/api/channels/messages.rs +++ b/src/api/channels/messages.rs @@ -9,17 +9,15 @@ use crate::ratelimiter::ChorusRequest; use crate::types::{Message, MessageSendSchema, PartialDiscordFileAttachment, Snowflake}; impl Message { - /** - Sends a message to the Spacebar server. - # Arguments - * `url_api` - The URL of the Spacebar server's API. - * `message` - The [`Message`] that will be sent to the Spacebar server. - * `limits_user` - The [`Limits`] of the user. - * `limits_instance` - The [`Limits`] of the instance. - * `requester` - The [`LimitedRequester`] that will be used to make requests to the Spacebar server. - # Errors - * [`ChorusLibError`] - If the message cannot be sent. - */ + /// Sends a message to the Spacebar server. + /// # Arguments + /// * `url_api` - The URL of the Spacebar server's API. + /// * `message` - The [`Message`] that will be sent to the Spacebar server. + /// * `limits_user` - The [`Limits`] of the user. + /// * `limits_instance` - The [`Limits`] of the instance. + /// * `requester` - The [`LimitedRequester`] that will be used to make requests to the Spacebar server. + /// # Errors + /// * [`ChorusLibError`] - If the message cannot be sent. pub async fn send( user: &mut UserMeta, channel_id: Snowflake, @@ -78,18 +76,17 @@ impl Message { } impl UserMeta { + /// Sends a message to the Spacebar server. + /// # Arguments + /// * `url_api` - The URL of the Spacebar server's API. + /// * `message` - The [`Message`] that will be sent to the Spacebar server. + /// * `limits_user` - The [`Limits`] of the user. + /// * `limits_instance` - The [`Limits`] of the instance. + /// * `requester` - The [`LimitedRequester`] that will be used to make requests to the Spacebar server. + /// # Errors + /// * [`ChorusLibError`] - If the message cannot be sent. + /// # Notes /// Shorthand call for Message::send() - /** - Sends a message to the Spacebar server. - # Arguments - * `url_api` - The URL of the Spacebar server's API. - * `message` - The [`Message`] that will be sent to the Spacebar server. - * `limits_user` - The [`Limits`] of the user. - * `limits_instance` - The [`Limits`] of the instance. - * `requester` - The [`LimitedRequester`] that will be used to make requests to the Spacebar server. - # Errors - * [`ChorusLibError`] - If the message cannot be sent. - */ pub async fn send_message( &mut self, message: &mut MessageSendSchema, diff --git a/src/api/channels/reactions.rs b/src/api/channels/reactions.rs index 35dbb94..70c16ce 100644 --- a/src/api/channels/reactions.rs +++ b/src/api/channels/reactions.rs @@ -8,9 +8,7 @@ use crate::{ types::{self, PublicUser, Snowflake}, }; -/** -Useful metadata for working with [`types::Reaction`], bundled together nicely. - */ +/// Useful metadata for working with [`types::Reaction`], bundled together nicely. pub struct ReactionMeta { pub message_id: types::Snowflake, pub channel_id: types::Snowflake, diff --git a/src/api/users/users.rs b/src/api/users/users.rs index bd46a36..7c67c7d 100644 --- a/src/api/users/users.rs +++ b/src/api/users/users.rs @@ -140,16 +140,14 @@ impl User { } impl Instance { - /** - Get a user object by id, or get the current user. - # Arguments - * `token` - A valid access token for the API. - * `id` - The id of the user that will be retrieved. If this is None, the current user will be retrieved. - # Errors - * [`ChorusLibError`] - If the request fails. - # Notes - This function is a wrapper around [`User::get`]. - */ + // Get a user object by id, or get the current user. + // # Arguments + // * `token` - A valid access token for the API. + // * `id` - The id of the user that will be retrieved. If this is None, the current user will be retrieved. + // # Errors + // * [`ChorusLibError`] - If the request fails. + // # Notes + // This function is a wrapper around [`User::get`]. pub async fn get_user(&mut self, token: String, id: Option<&String>) -> ChorusResult { let mut user = UserMeta::shell(Rc::new(RefCell::new(self.clone())), token); let result = User::get(&mut user, id).await; diff --git a/src/instance.rs b/src/instance.rs index 15c513c..d40d900 100644 --- a/src/instance.rs +++ b/src/instance.rs @@ -14,10 +14,8 @@ use crate::types::{GeneralConfiguration, User, UserSettings}; use crate::UrlBundle; #[derive(Debug, Clone)] -/** -The [`Instance`] what you will be using to perform all sorts of actions on the Spacebar server. -If `limits_information` is `None`, then the instance will not be rate limited. - */ +/// The [`Instance`]; what you will be using to perform all sorts of actions on the Spacebar server. +/// If `limits_information` is `None`, then the instance will not be rate limited. pub struct Instance { pub urls: UrlBundle, pub instance_info: GeneralConfiguration, diff --git a/src/types/entities/attachment.rs b/src/types/entities/attachment.rs index 7bd9d2b..4261203 100644 --- a/src/types/entities/attachment.rs +++ b/src/types/entities/attachment.rs @@ -41,11 +41,7 @@ pub struct PartialDiscordFileAttachment { } impl PartialDiscordFileAttachment { - /** - Moves `self.content` out of `self` and returns it. - # Returns - Vec - */ + /// Moves `self.content` out of `self` and returns it. pub fn move_content(self) -> (Vec, PartialDiscordFileAttachment) { let content = self.content; let updated_struct = PartialDiscordFileAttachment {