mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-24 13:16:28 +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
-6
@@ -58,7 +58,7 @@ impl HttpFileWriter {
|
||||
.body(body)
|
||||
.send()
|
||||
.await
|
||||
.map_err(|e| io::Error::new(io::ErrorKind::Other, e))
|
||||
.map_err(io::Error::other)
|
||||
{
|
||||
error!("HttpFileWriter put file err: {:?}", err);
|
||||
|
||||
@@ -111,7 +111,7 @@ impl HttpFileReader {
|
||||
))
|
||||
.send()
|
||||
.await
|
||||
.map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
|
||||
.map_err(io::Error::other)?;
|
||||
|
||||
let inner = Box::new(StreamReader::new(resp.bytes_stream().map_err(io::Error::other)));
|
||||
|
||||
@@ -202,7 +202,8 @@ mod tests {
|
||||
#[tokio::test]
|
||||
async fn test_constants() {
|
||||
assert_eq!(READ_BUFFER_SIZE, 1024 * 1024);
|
||||
assert!(READ_BUFFER_SIZE > 0);
|
||||
// READ_BUFFER_SIZE is a compile-time constant, no need to assert
|
||||
// assert!(READ_BUFFER_SIZE > 0);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
@@ -463,7 +464,8 @@ mod tests {
|
||||
let _writer: FileWriter = Box::new(writer_rx);
|
||||
|
||||
// If this compiles, the types are correctly defined
|
||||
assert!(true);
|
||||
// This is a placeholder test - remove meaningless assertion
|
||||
// assert!(true);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
@@ -483,8 +485,9 @@ mod tests {
|
||||
#[tokio::test]
|
||||
async fn test_read_buffer_size_constant() {
|
||||
assert_eq!(READ_BUFFER_SIZE, 1024 * 1024);
|
||||
assert!(READ_BUFFER_SIZE > 0);
|
||||
assert!(READ_BUFFER_SIZE % 1024 == 0, "Buffer size should be a multiple of 1024");
|
||||
// READ_BUFFER_SIZE is a compile-time constant, no need to assert
|
||||
// assert!(READ_BUFFER_SIZE > 0);
|
||||
// assert!(READ_BUFFER_SIZE % 1024 == 0, "Buffer size should be a multiple of 1024");
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
||||
Reference in New Issue
Block a user