fix: resolve all clippy warnings and enforce cargo fmt
- display_helpers: convert module doc-comments to regular comments, merge identical text/markdown + text/ branches - search_service: replace needless range loops with slice-based pagination - folder_repository, folder_db_repository: collapse nested if statements - favorites_pg_repository: remove unnecessary borrow on generic arg - file_blob_read_repository: collapse 6 nested if-let blocks - file_blob_write_repository: collapse nested if for dedup ref decrement - chunked_upload_service: use div_ceil(), collapse 2 nested if blocks - folder_handler: collapse nested if-let for owner check - webdav_handler: replace 7x io::Error::new(ErrorKind::Other, ..) with io::Error::other(..) - cargo fmt applied to all files Passes: cargo clippy --all-targets --all-features -- -D warnings
This commit is contained in:
@@ -165,10 +165,7 @@ pub trait FileRetrievalUseCase: Send + Sync + 'static {
|
||||
/// Lists every file in the subtree rooted at `folder_id`.
|
||||
///
|
||||
/// Default: falls back to `list_files(Some(folder_id))` (one level).
|
||||
async fn list_files_in_subtree(
|
||||
&self,
|
||||
folder_id: &str,
|
||||
) -> Result<Vec<FileDto>, DomainError> {
|
||||
async fn list_files_in_subtree(&self, folder_id: &str) -> Result<Vec<FileDto>, DomainError> {
|
||||
self.list_files(Some(folder_id)).await
|
||||
}
|
||||
|
||||
@@ -183,7 +180,11 @@ pub trait FileRetrievalUseCase: Send + Sync + 'static {
|
||||
limit: i64,
|
||||
) -> Result<Vec<FileDto>, DomainError> {
|
||||
let all = self.list_files(folder_id).await?;
|
||||
Ok(all.into_iter().skip(offset as usize).take(limit as usize).collect())
|
||||
Ok(all
|
||||
.into_iter()
|
||||
.skip(offset as usize)
|
||||
.take(limit as usize)
|
||||
.collect())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,10 +76,7 @@ pub trait FolderUseCase: Send + Sync + 'static {
|
||||
/// ordered by path. Uses ltree `<@` — single GiST-indexed query.
|
||||
///
|
||||
/// Default: returns an empty vec (stubs / mocks).
|
||||
async fn list_subtree_folders(
|
||||
&self,
|
||||
folder_id: &str,
|
||||
) -> Result<Vec<FolderDto>, DomainError> {
|
||||
async fn list_subtree_folders(&self, folder_id: &str) -> Result<Vec<FolderDto>, DomainError> {
|
||||
let _ = folder_id;
|
||||
Ok(Vec::new())
|
||||
}
|
||||
@@ -97,7 +94,11 @@ pub trait SearchUseCase: Send + Sync + 'static {
|
||||
///
|
||||
/// `user_id` identifies the authenticated user so that SQL queries filter
|
||||
/// by owner and the result cache is isolated per tenant.
|
||||
async fn search(&self, criteria: SearchCriteriaDto, user_id: &str) -> Result<SearchResultsDto, DomainError>;
|
||||
async fn search(
|
||||
&self,
|
||||
criteria: SearchCriteriaDto,
|
||||
user_id: &str,
|
||||
) -> Result<SearchResultsDto, DomainError>;
|
||||
|
||||
/// Returns quick suggestions for autocomplete (lightweight, fast).
|
||||
async fn suggest(
|
||||
|
||||
@@ -100,10 +100,7 @@ pub trait FileReadPort: Send + Sync + 'static {
|
||||
/// subtree is fetched in a single GiST-indexed query.
|
||||
///
|
||||
/// Default: falls back to `list_files(Some(folder_id))` (one level).
|
||||
async fn list_files_in_subtree(
|
||||
&self,
|
||||
folder_id: &str,
|
||||
) -> Result<Vec<File>, DomainError> {
|
||||
async fn list_files_in_subtree(&self, folder_id: &str) -> Result<Vec<File>, DomainError> {
|
||||
self.list_files(Some(folder_id)).await
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user