style: apply cargo fmt formatting to existing codebase
Run `cargo fmt` across all Rust source files to enforce consistent formatting (import ordering, line wrapping, match arm braces). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
use axum::{Json, extract::{Path, State}, http::StatusCode, response::IntoResponse};
|
||||
use axum::{
|
||||
Json,
|
||||
extract::{Path, State},
|
||||
http::StatusCode,
|
||||
response::IntoResponse,
|
||||
};
|
||||
use serde::Deserialize;
|
||||
use std::sync::Arc;
|
||||
use tracing::{error, info};
|
||||
|
||||
@@ -90,9 +90,12 @@ impl FolderHandler {
|
||||
if owner != &auth_user.id {
|
||||
tracing::warn!(
|
||||
"get_folder: user '{}' attempted to access folder '{}' owned by '{}'",
|
||||
auth_user.id, id, owner
|
||||
auth_user.id,
|
||||
id,
|
||||
owner
|
||||
);
|
||||
return (StatusCode::NOT_FOUND, "Folder not found".to_string()).into_response();
|
||||
return (StatusCode::NOT_FOUND, "Folder not found".to_string())
|
||||
.into_response();
|
||||
}
|
||||
}
|
||||
(StatusCode::OK, Json(folder)).into_response()
|
||||
@@ -144,7 +147,10 @@ impl FolderHandler {
|
||||
Path(id): Path<String>,
|
||||
pagination: Query<PaginationRequestDto>,
|
||||
) -> axum::response::Response {
|
||||
match service.list_folders_for_owner_paginated(Some(&id), &auth_user.id, &pagination).await {
|
||||
match service
|
||||
.list_folders_for_owner_paginated(Some(&id), &auth_user.id, &pagination)
|
||||
.await
|
||||
{
|
||||
Ok(paginated_result) => (StatusCode::OK, Json(paginated_result)).into_response(),
|
||||
Err(err) => {
|
||||
let status = match err.kind {
|
||||
@@ -168,7 +174,10 @@ impl FolderHandler {
|
||||
parent_id: Option<&str>,
|
||||
auth_user: &AuthUser,
|
||||
) -> axum::response::Response {
|
||||
match service.list_folders_for_owner(parent_id, &auth_user.id).await {
|
||||
match service
|
||||
.list_folders_for_owner(parent_id, &auth_user.id)
|
||||
.await
|
||||
{
|
||||
Ok(folders) => (StatusCode::OK, Json(folders)).into_response(),
|
||||
Err(err) => {
|
||||
let status = match err.kind {
|
||||
@@ -360,7 +369,9 @@ impl FolderHandler {
|
||||
if folder.owner_id.as_deref() != Some(&auth_user.id) {
|
||||
tracing::warn!(
|
||||
"download_folder_zip: user '{}' attempted to download folder '{}' owned by '{:?}'",
|
||||
auth_user.id, id, folder.owner_id
|
||||
auth_user.id,
|
||||
id,
|
||||
folder.owner_id
|
||||
);
|
||||
return (
|
||||
StatusCode::NOT_FOUND,
|
||||
|
||||
@@ -765,7 +765,11 @@ async fn handle_move(
|
||||
};
|
||||
|
||||
folder_service
|
||||
.move_folder(&folder.id, move_dto, folder.owner_id.as_deref().unwrap_or("webdav"))
|
||||
.move_folder(
|
||||
&folder.id,
|
||||
move_dto,
|
||||
folder.owner_id.as_deref().unwrap_or("webdav"),
|
||||
)
|
||||
.await
|
||||
.map_err(|e| AppError::internal_error(format!("Failed to move folder: {}", e)))?;
|
||||
|
||||
@@ -775,7 +779,11 @@ async fn handle_move(
|
||||
};
|
||||
|
||||
folder_service
|
||||
.rename_folder(&folder.id, rename_dto, folder.owner_id.as_deref().unwrap_or("webdav"))
|
||||
.rename_folder(
|
||||
&folder.id,
|
||||
rename_dto,
|
||||
folder.owner_id.as_deref().unwrap_or("webdav"),
|
||||
)
|
||||
.await
|
||||
.map_err(|e| AppError::internal_error(format!("Failed to rename folder: {}", e)))?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user