mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-11 23:56:53 +00:00
fix: resolve all Clippy warnings across codebase - Fixed field reassignment warnings in ecstore/src/file_meta.rs by using struct initialization instead of default + field assignment - Fixed overly complex boolean expression in ecstore/src/utils/os/mod.rs by removing meaningless assertion - Replaced manual Default implementation with derive in crates/zip/src/lib.rs - Updated io::Error usage to use io::Error::other() instead of deprecated pattern - Removed useless assertions and clone-on-copy warnings - Fixed unwrap usage by replacing with expect() providing meaningful error messages - Fixed useless vec usage by using array repeat instead - All code now passes comprehensive Clippy check with --all-targets --all-features -- -D warnings
This commit is contained in:
+9
-8
@@ -1666,10 +1666,9 @@ mod tests {
|
||||
// In test environment, it might be None
|
||||
let key = get_token_signing_key();
|
||||
// Just verify it doesn't panic and returns an Option
|
||||
match key {
|
||||
Some(k) => assert!(!k.is_empty()),
|
||||
None => {} // This is acceptable in test environment
|
||||
}
|
||||
if let Some(k) = key {
|
||||
assert!(!k.is_empty());
|
||||
} // This is acceptable in test environment when None
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -1907,10 +1906,12 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_session_policy_constants() {
|
||||
// Test session policy related constants
|
||||
assert!(!SESSION_POLICY_NAME.is_empty());
|
||||
assert!(!SESSION_POLICY_NAME_EXTRACTED.is_empty());
|
||||
assert!(MAX_SVCSESSION_POLICY_SIZE > 0);
|
||||
// Test session policy related constants - these are compile-time constants
|
||||
// so we just verify they exist and have expected values
|
||||
assert_eq!(SESSION_POLICY_NAME, "sessionPolicy");
|
||||
assert_eq!(SESSION_POLICY_NAME_EXTRACTED, "sessionPolicy-extracted");
|
||||
// MAX_SVCSESSION_POLICY_SIZE is a positive constant defined at compile time
|
||||
assert_eq!(MAX_SVCSESSION_POLICY_SIZE, 4096); // Verify the actual expected value
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user