mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-30 08:49:26 +00:00
clippy
This commit is contained in:
+1
-5
@@ -5,10 +5,7 @@ use std::task::{Context, Poll};
|
|||||||
use tokio::fs::File;
|
use tokio::fs::File;
|
||||||
use tokio::io::{self, AsyncRead, AsyncWrite, ReadBuf};
|
use tokio::io::{self, AsyncRead, AsyncWrite, ReadBuf};
|
||||||
|
|
||||||
#[derive(Default)]
|
|
||||||
pub enum Reader {
|
pub enum Reader {
|
||||||
#[default]
|
|
||||||
NotUse,
|
|
||||||
File(File),
|
File(File),
|
||||||
Buffer(VecAsyncReader),
|
Buffer(VecAsyncReader),
|
||||||
}
|
}
|
||||||
@@ -18,7 +15,6 @@ impl AsyncRead for Reader {
|
|||||||
match self.get_mut() {
|
match self.get_mut() {
|
||||||
Reader::File(file) => Pin::new(file).poll_read(cx, buf),
|
Reader::File(file) => Pin::new(file).poll_read(cx, buf),
|
||||||
Reader::Buffer(buffer) => Pin::new(buffer).poll_read(cx, buf),
|
Reader::Buffer(buffer) => Pin::new(buffer).poll_read(cx, buf),
|
||||||
Reader::NotUse => Poll::Ready(Ok(())),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -203,7 +199,7 @@ impl VecAsyncReader {
|
|||||||
|
|
||||||
// Implementing AsyncRead trait for VecAsyncReader
|
// Implementing AsyncRead trait for VecAsyncReader
|
||||||
impl AsyncRead for VecAsyncReader {
|
impl AsyncRead for VecAsyncReader {
|
||||||
fn poll_read(self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut ReadBuf) -> Poll<io::Result<()>> {
|
fn poll_read(self: Pin<&mut Self>, _cx: &mut Context<'_>, buf: &mut ReadBuf) -> Poll<io::Result<()>> {
|
||||||
let this = self.get_mut();
|
let this = self.get_mut();
|
||||||
|
|
||||||
// Check how many bytes are available to read
|
// Check how many bytes are available to read
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ pub struct NotificationPeerErr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl NotificationSys {
|
impl NotificationSys {
|
||||||
pub fn rest_client_from_hash(&self, s: &str) -> Option<PeerRestClient> {
|
pub fn rest_client_from_hash(&self, _s: &str) -> Option<PeerRestClient> {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
pub async fn delete_policy(&self) -> Vec<NotificationPeerErr> {
|
pub async fn delete_policy(&self) -> Vec<NotificationPeerErr> {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ use std::{
|
|||||||
time::Duration,
|
time::Duration,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use crate::heal::heal_ops::{HealEntryFn, HealSequence};
|
||||||
use crate::{
|
use crate::{
|
||||||
bitrot::{bitrot_verify, close_bitrot_writers, new_bitrot_filereader, new_bitrot_filewriter, BitrotFileWriter},
|
bitrot::{bitrot_verify, close_bitrot_writers, new_bitrot_filereader, new_bitrot_filewriter, BitrotFileWriter},
|
||||||
cache_value::metacache_set::{list_path_raw, ListPathRawOptions},
|
cache_value::metacache_set::{list_path_raw, ListPathRawOptions},
|
||||||
@@ -16,8 +17,8 @@ use crate::{
|
|||||||
format::FormatV3,
|
format::FormatV3,
|
||||||
new_disk, BufferReader, BufferWriter, CheckPartsResp, DeleteOptions, DiskAPI, DiskInfo, DiskInfoOptions, DiskOption,
|
new_disk, BufferReader, BufferWriter, CheckPartsResp, DeleteOptions, DiskAPI, DiskInfo, DiskInfoOptions, DiskOption,
|
||||||
DiskStore, FileInfoVersions, FileReader, FileWriter, MetaCacheEntries, MetaCacheEntry, MetadataResolutionParams,
|
DiskStore, FileInfoVersions, FileReader, FileWriter, MetaCacheEntries, MetaCacheEntry, MetadataResolutionParams,
|
||||||
ReadMultipleReq, ReadMultipleResp, ReadOptions, UpdateMetadataOpts, WalkDirOptions, RUSTFS_META_BUCKET,
|
ReadMultipleReq, ReadMultipleResp, ReadOptions, UpdateMetadataOpts, RUSTFS_META_BUCKET, RUSTFS_META_MULTIPART_BUCKET,
|
||||||
RUSTFS_META_MULTIPART_BUCKET, RUSTFS_META_TMP_BUCKET,
|
RUSTFS_META_TMP_BUCKET,
|
||||||
},
|
},
|
||||||
erasure::Erasure,
|
erasure::Erasure,
|
||||||
error::{Error, Result},
|
error::{Error, Result},
|
||||||
@@ -55,10 +56,6 @@ use crate::{
|
|||||||
heal::data_scanner::{globalHealConfig, HEAL_DELETE_DANGLING},
|
heal::data_scanner::{globalHealConfig, HEAL_DELETE_DANGLING},
|
||||||
store_api::ListObjectVersionsInfo,
|
store_api::ListObjectVersionsInfo,
|
||||||
};
|
};
|
||||||
use crate::{
|
|
||||||
heal::heal_ops::{HealEntryFn, HealSequence},
|
|
||||||
io::Writer,
|
|
||||||
};
|
|
||||||
use futures::future::join_all;
|
use futures::future::join_all;
|
||||||
use glob::Pattern;
|
use glob::Pattern;
|
||||||
use http::HeaderMap;
|
use http::HeaderMap;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ use std::io::ErrorKind;
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use tokio::sync::broadcast::{self, Receiver as B_Receiver};
|
use tokio::sync::broadcast::{self, Receiver as B_Receiver};
|
||||||
use tokio::sync::mpsc::{self, Receiver, Sender};
|
use tokio::sync::mpsc::{self, Receiver, Sender};
|
||||||
use tracing::{error, warn};
|
use tracing::error;
|
||||||
|
|
||||||
const MAX_OBJECT_LIST: i32 = 1000;
|
const MAX_OBJECT_LIST: i32 = 1000;
|
||||||
// const MAX_DELETE_LIST: i32 = 1000;
|
// const MAX_DELETE_LIST: i32 = 1000;
|
||||||
|
|||||||
Reference in New Issue
Block a user