From 0460a67bdd68de5ed66007ba5876a00b13cbf775 Mon Sep 17 00:00:00 2001 From: Flori Weber Date: Sun, 18 Jun 2023 15:39:52 +0200 Subject: [PATCH] Change returns, add documentation --- src/api/users/relationships.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/api/users/relationships.rs b/src/api/users/relationships.rs index 563b846..a678da9 100644 --- a/src/api/users/relationships.rs +++ b/src/api/users/relationships.rs @@ -16,11 +16,11 @@ impl UserMeta { /// * `user_id` - A string slice that holds the ID of the user to retrieve the mutual relationships with. /// /// # Returns - /// This function returns a [`Option>>`]. + /// This function returns a [`Result, ChorusLibError>`]. pub async fn get_mutual_relationships( &mut self, user_id: &str, - ) -> Result>, ChorusLibError> { + ) -> Result, ChorusLibError> { let belongs_to = self.belongs_to.borrow(); let url = format!( "{}/users/{}/relationships/", @@ -29,7 +29,7 @@ impl UserMeta { ); drop(belongs_to); let request = Client::new().get(url).bearer_auth(self.token()); - deserialize_response::>>( + deserialize_response::>( request, self, crate::api::limits::LimitType::Global, @@ -37,6 +37,10 @@ impl UserMeta { .await } + /// Retrieves the authenticated user's relationships. + /// + /// # Returns + /// This function returns a [`Result, ChorusLibError>`]. pub async fn get_relationships(&mut self) -> Result, ChorusLibError> { let belongs_to = self.belongs_to.borrow(); let url = format!("{}/users/@me/relationships/", belongs_to.urls.get_api(),);