fix: resolve all clippy warnings and convert integration_tests to custom cfg
- Add type aliases (FileRow, FolderRow, FolderRowPaginated, FolderRowOptUser) to reduce type complexity - Simplify redundant closures in app_password_handler and webdav_handler - Remove needless borrow in auth_handler - Collapse nested if/let chains in login_lockout, webdav_lock, auth, rate_limit - Box LockEntry in acquire() Err variant to fix large enum variant warning - Rename DeviceCodeStatus::from_str to parse to avoid should_implement_trait lint - Add #[allow(clippy::too_many_arguments)] and #[allow(clippy::result_unit_err)] where appropriate - Convert integration_tests from cargo feature to custom cfg attribute - Add check-cfg lint config in Cargo.toml for integration_tests cfg
This commit is contained in:
@@ -28,7 +28,7 @@ impl DeviceCodeStatus {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_str(s: &str) -> Option<Self> {
|
||||
pub fn parse(s: &str) -> Option<Self> {
|
||||
match s {
|
||||
"pending" => Some(Self::Pending),
|
||||
"authorized" => Some(Self::Authorized),
|
||||
@@ -76,6 +76,7 @@ impl DeviceCode {
|
||||
/// * `verification_uri` — URL the user must visit
|
||||
/// * `expires_in_secs` — TTL for the device code
|
||||
/// * `poll_interval_secs` — minimum polling interval
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn new(
|
||||
device_code: String,
|
||||
user_code: String,
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
//! Concrete implementations (filesystem, PostgreSQL, S3, etc.) live in
|
||||
//! the infrastructure layer.
|
||||
|
||||
|
||||
use crate::common::errors::DomainError;
|
||||
use crate::domain::entities::folder::Folder;
|
||||
use crate::domain::services::path_service::StoragePath;
|
||||
|
||||
@@ -21,7 +21,10 @@ impl StoragePath {
|
||||
/// Creates a new storage path, silently dropping any traversal segments
|
||||
pub fn new(segments: Vec<String>) -> Self {
|
||||
Self {
|
||||
segments: segments.into_iter().filter(|s| Self::is_safe_segment(s)).collect(),
|
||||
segments: segments
|
||||
.into_iter()
|
||||
.filter(|s| Self::is_safe_segment(s))
|
||||
.collect(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,12 +189,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_new_strips_traversal_segments() {
|
||||
let path = StoragePath::new(vec![
|
||||
"..".into(),
|
||||
"etc".into(),
|
||||
".".into(),
|
||||
"passwd".into(),
|
||||
]);
|
||||
let path = StoragePath::new(vec!["..".into(), "etc".into(), ".".into(), "passwd".into()]);
|
||||
assert_eq!(path.segments(), &["etc", "passwd"]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user