Skip to content

Commit

Permalink
refactor: removed unused Panic docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mario-nt committed Aug 12, 2024
1 parent 4359a77 commit 5f9ca11
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 14 deletions.
4 changes: 0 additions & 4 deletions src/services/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ impl Service {
/// * The image URL is not an image.
/// * The image is too big.
/// * The user quota is met.
///
/// # Panics
///
/// The function panics if the optional user id has no value
pub async fn get_image_by_url(&self, url: &str, maybe_user_id: Option<UserId>) -> Result<Bytes, Error> {
let Some(user_id) = maybe_user_id else {
return Err(Error::Unauthenticated);
Expand Down
1 change: 0 additions & 1 deletion src/services/torrent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ impl Index {
/// This function will panic if:
///
/// * Unable to parse the torrent info-hash.
/// * The optional user id has no value
pub async fn add_torrent(
&self,
add_torrent_req: AddTorrentRequest,
Expand Down
6 changes: 0 additions & 6 deletions src/services/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,6 @@ impl ProfileService {
/// * An error if unable to successfully hash the password.
/// * An error if unable to change the password in the database.
/// * An error if it is not possible to authorize the action
/// # Panics
///
/// The function panics if the optional user id has no value
pub async fn change_password(
&self,
maybe_user_id: Option<UserId>,
Expand Down Expand Up @@ -304,9 +301,6 @@ impl BanService {
/// * `ServiceError::InternalServerError` if unable get user from the request.
/// * An error if unable to get user profile from supplied username.
/// * An error if unable to set the ban of the user in the database.
/// # Panics
///
/// The function panics if the optional user id has no value
pub async fn ban_user(&self, username_to_be_banned: &str, maybe_user_id: Option<UserId>) -> Result<(), ServiceError> {
let Some(user_id) = maybe_user_id else {
return Err(ServiceError::UnauthorizedActionForGuests);
Expand Down
4 changes: 1 addition & 3 deletions src/web/api/server/v1/contexts/user/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,8 @@ pub async fn renew_token_handler(
/// It returns an error if:
///
/// - The user account is not found.
/// # Panics
///
/// The function panics if the optional user id has no value
#[allow(clippy::unused_async)]
#[allow(clippy::missing_panics_doc)]
pub async fn change_password_handler(
State(app_data): State<Arc<AppData>>,
ExtractOptionalLoggedInUser(maybe_user_id): ExtractOptionalLoggedInUser,
Expand Down

0 comments on commit 5f9ca11

Please sign in to comment.