fix: resolve all clippy warnings for CI (async_fn_in_trait, collapsible_if, type_complexity, dead_code)

- Allow async_fn_in_trait lint crate-wide (internal project, 413 warnings)
- Add integration_tests feature to Cargo.toml to fix unexpected cfg warnings
- Collapse nested if statements into single conditions (13 locations)
- Add type_complexity allows on pg repository functions (12 locations)
- Fix dead code warnings in test modules with allow attributes
- Fix E0599 by gating new_stub() for integration_tests feature
- Add result_unit_err and result_large_err allows where appropriate
- Apply rustfmt formatting

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
zjean
2026-03-04 21:40:38 +01:00
parent a7de63d80f
commit 45c60faeb5
11 changed files with 77 additions and 52 deletions
@@ -63,15 +63,15 @@ pub async fn basic_auth_middleware(
parse_basic_auth(auth_header).ok_or(NextcloudAuthError::Unauthorized)?;
// Check account lockout before attempting password verification (saves CPU)
if let Some(auth_svc) = state.auth_service.as_ref() {
if let Err(secs) = auth_svc.login_lockout.check(&username) {
tracing::warn!(
username = %username,
lockout_remaining_secs = secs,
"[NC] Account locked — too many failed attempts"
);
return Err(NextcloudAuthError::Unauthorized);
}
if let Some(auth_svc) = state.auth_service.as_ref()
&& let Err(secs) = auth_svc.login_lockout.check(&username)
{
tracing::warn!(
username = %username,
lockout_remaining_secs = secs,
"[NC] Account locked — too many failed attempts"
);
return Err(NextcloudAuthError::Unauthorized);
}
let nextcloud = state