Skip to content

Commit

Permalink
chore: fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
josecelano committed Feb 9, 2024
1 parent 3d3fc2d commit 47f5242
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions src/web/api/client/v1/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ impl Client {

/// # Errors
///
/// Will panic if the request fails.
/// Will return an error if the request fails.
pub async fn about(&self) -> Result<TextResponse, Error> {
self.http_client.get("/about", Query::empty()).await.map_err(Error::from)
}

/// # Errors
///
/// Will panic if the request fails.
/// Will return an error if the request fails.
pub async fn license(&self) -> Result<TextResponse, Error> {
self.http_client
.get("/about/license", Query::empty())
Expand All @@ -76,14 +76,14 @@ impl Client {

/// # Errors
///
/// Will panic if the request fails.
/// Will return an error if the request fails.
pub async fn get_categories(&self) -> Result<TextResponse, Error> {
self.http_client.get("/category", Query::empty()).await.map_err(Error::from)
}

/// # Errors
///
/// Will panic if the request fails.
/// Will return an error if the request fails.
pub async fn add_category(&self, add_category_form: AddCategoryForm) -> Result<TextResponse, Error> {
self.http_client
.post("/category", &add_category_form)
Expand All @@ -93,7 +93,7 @@ impl Client {

/// # Errors
///
/// Will panic if the request fails.
/// Will return an error if the request fails.
pub async fn delete_category(&self, delete_category_form: DeleteCategoryForm) -> Result<TextResponse, Error> {
self.http_client
.delete_with_body("/category", &delete_category_form)
Expand All @@ -105,21 +105,21 @@ impl Client {

/// # Errors
///
/// Will panic if the request fails.
/// Will return an error if the request fails.
pub async fn get_tags(&self) -> Result<TextResponse, Error> {
self.http_client.get("/tags", Query::empty()).await.map_err(Error::from)
}

/// # Errors
///
/// Will panic if the request fails.
/// Will return an error if the request fails.
pub async fn add_tag(&self, add_tag_form: AddTagForm) -> Result<TextResponse, Error> {
self.http_client.post("/tag", &add_tag_form).await.map_err(Error::from)
}

/// # Errors
///
/// Will panic if the request fails.
/// Will return an error if the request fails.
pub async fn delete_tag(&self, delete_tag_form: DeleteTagForm) -> Result<TextResponse, Error> {
self.http_client
.delete_with_body("/tag", &delete_tag_form)
Expand All @@ -131,7 +131,7 @@ impl Client {

/// # Errors
///
/// Will panic if the request fails.
/// Will return an error if the request fails.
pub async fn root(&self) -> Result<TextResponse, Error> {
self.http_client.get("", Query::empty()).await.map_err(Error::from)
}
Expand All @@ -140,7 +140,7 @@ impl Client {

/// # Errors
///
/// Will panic if the request fails.
/// Will return an error if the request fails.
pub async fn get_public_settings(&self) -> Result<TextResponse, Error> {
self.http_client
.get("/settings/public", Query::empty())
Expand All @@ -150,7 +150,7 @@ impl Client {

/// # Errors
///
/// Will panic if the request fails.
/// Will return an error if the request fails.
pub async fn get_site_name(&self) -> Result<TextResponse, Error> {
self.http_client
.get("/settings/name", Query::empty())
Expand All @@ -160,7 +160,7 @@ impl Client {

/// # Errors
///
/// Will panic if the request fails.
/// Will return an error if the request fails.
pub async fn get_settings(&self) -> Result<TextResponse, Error> {
self.http_client.get("/settings", Query::empty()).await.map_err(Error::from)
}
Expand All @@ -169,14 +169,14 @@ impl Client {

/// # Errors
///
/// Will panic if the request fails.
/// Will return an error if the request fails.
pub async fn get_torrents(&self, params: Query) -> Result<TextResponse, Error> {
self.http_client.get("/torrents", params).await.map_err(Error::from)
}

/// # Errors
///
/// Will panic if the request fails.
/// Will return an error if the request fails.
pub async fn get_torrent(&self, info_hash: &InfoHash) -> Result<TextResponse, Error> {
self.http_client
.get(&format!("/torrent/{info_hash}"), Query::empty())
Expand All @@ -186,7 +186,7 @@ impl Client {

/// # Errors
///
/// Will panic if the request fails.
/// Will return an error if the request fails.
pub async fn delete_torrent(&self, info_hash: &InfoHash) -> Result<TextResponse, Error> {
self.http_client
.delete(&format!("/torrent/{info_hash}"))
Expand All @@ -196,7 +196,7 @@ impl Client {

/// # Errors
///
/// Will panic if the request fails.
/// Will return an error if the request fails.
pub async fn update_torrent(
&self,
info_hash: &InfoHash,
Expand All @@ -210,7 +210,7 @@ impl Client {

/// # Errors
///
/// Will panic if the request fails.
/// Will return an error if the request fails.
pub async fn upload_torrent(&self, form: multipart::Form) -> Result<TextResponse, Error> {
self.http_client
.post_multipart("/torrent/upload", form)
Expand All @@ -220,7 +220,7 @@ impl Client {

/// # Errors
///
/// Will panic if the request fails.
/// Will return an error if the request fails.
pub async fn download_torrent(&self, info_hash: &InfoHash) -> Result<responses::BinaryResponse, Error> {
self.http_client
.get_binary(&format!("/torrent/download/{info_hash}"), Query::empty())
Expand All @@ -232,7 +232,7 @@ impl Client {

/// # Errors
///
/// Will panic if the request fails.
/// Will return an error if the request fails.
pub async fn register_user(&self, registration_form: RegistrationForm) -> Result<TextResponse, Error> {
self.http_client
.post("/user/register", &registration_form)
Expand All @@ -242,7 +242,7 @@ impl Client {

/// # Errors
///
/// Will panic if the request fails.
/// Will return an error if the request fails.
pub async fn login_user(&self, registration_form: LoginForm) -> Result<TextResponse, Error> {
self.http_client
.post("/user/login", &registration_form)
Expand All @@ -252,7 +252,7 @@ impl Client {

/// # Errors
///
/// Will panic if the request fails.
/// Will return an error if the request fails.
pub async fn verify_token(&self, token_verification_form: TokenVerificationForm) -> Result<TextResponse, Error> {
self.http_client
.post("/user/token/verify", &token_verification_form)
Expand All @@ -262,7 +262,7 @@ impl Client {

/// # Errors
///
/// Will panic if the request fails.
/// Will return an error if the request fails.
pub async fn renew_token(&self, token_verification_form: TokenRenewalForm) -> Result<TextResponse, Error> {
self.http_client
.post("/user/token/renew", &token_verification_form)
Expand All @@ -272,7 +272,7 @@ impl Client {

/// # Errors
///
/// Will panic if the request fails.
/// Will return an error if the request fails.
pub async fn ban_user(&self, username: Username) -> Result<TextResponse, Error> {
self.http_client
.delete(&format!("/user/ban/{}", &username.value))
Expand Down

0 comments on commit 47f5242

Please sign in to comment.