mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-05 12:57:42 +00:00
build(toolchain): switch Rust channel to stable (#4775)
* Change Rust toolchain channel to stable Signed-off-by: houseme <housemecn@gmail.com> * style: apply clippy --fix and cargo fix lint suggestions Run `cargo clippy --fix --all-targets --all-features` and `cargo fix --lib --all-targets` across the workspace, then resolve the remaining warnings by hand: - collapse needless borrows in `format!` args, prefer `?` over explicit early returns, and use `.values()` / `.flatten()` iterator adapters - rewrite the `Md5` scan loop via `manual_flatten` and re-indent the `select!` macro body (rustfmt skips macro interiors) - annotate the intentional dead-code `Md5` inherent methods (constructed only by the test factory) with `#[allow(dead_code)]` Behavior is unchanged. Co-Authored-By: heihutu <heihutu@gmail.com> --------- Signed-off-by: houseme <housemecn@gmail.com> Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
@@ -5135,12 +5135,11 @@ impl LocalDisk {
|
||||
}
|
||||
|
||||
let metadata =
|
||||
with_walk_stall_timeout(stall, self.read_metadata(bucket, format!("{}/{}", ¤t, &entry).as_str()))
|
||||
.await?;
|
||||
with_walk_stall_timeout(stall, self.read_metadata(bucket, format!("{}/{}", current, entry).as_str())).await?;
|
||||
|
||||
let entry = entry.strip_suffix(STORAGE_FORMAT_FILE).unwrap_or_default().to_owned();
|
||||
let name = entry.trim_end_matches(SLASH_SEPARATOR);
|
||||
let name = decode_dir_object(format!("{}/{}", ¤t, &name).as_str());
|
||||
let name = decode_dir_object(format!("{}/{}", current, name).as_str());
|
||||
|
||||
if opts.limit <= 0 || metadata_counts_toward_limit(&metadata) {
|
||||
*objs_returned += 1;
|
||||
@@ -5252,7 +5251,7 @@ impl LocalDisk {
|
||||
meta.name.push_str(GLOBAL_DIR_SUFFIX_WITH_SLASH);
|
||||
}
|
||||
|
||||
let fname = format!("{}/{}", &meta.name, STORAGE_FORMAT_FILE);
|
||||
let fname = format!("{}/{}", meta.name, STORAGE_FORMAT_FILE);
|
||||
|
||||
match with_walk_stall_timeout(stall, self.read_metadata(&opts.bucket, fname.as_str())).await {
|
||||
Ok(res) => {
|
||||
@@ -6647,8 +6646,8 @@ impl DiskAPI for LocalDisk {
|
||||
}
|
||||
|
||||
// xl.meta path
|
||||
let src_file_path = self.get_object_path(src_volume, format!("{}/{}", &src_path, STORAGE_FORMAT_FILE).as_str())?;
|
||||
let dst_file_path = self.get_object_path(dst_volume, format!("{}/{}", &dst_path, STORAGE_FORMAT_FILE).as_str())?;
|
||||
let src_file_path = self.get_object_path(src_volume, format!("{}/{}", src_path, STORAGE_FORMAT_FILE).as_str())?;
|
||||
let dst_file_path = self.get_object_path(dst_volume, format!("{}/{}", dst_path, STORAGE_FORMAT_FILE).as_str())?;
|
||||
|
||||
// data_dir path
|
||||
let has_data_dir_path = {
|
||||
@@ -6664,11 +6663,11 @@ impl DiskAPI for LocalDisk {
|
||||
if let Some(data_dir) = has_data_dir {
|
||||
let src_data_path = self.get_object_path(
|
||||
src_volume,
|
||||
rustfs_utils::path::retain_slash(format!("{}/{}", &src_path, data_dir).as_str()).as_str(),
|
||||
rustfs_utils::path::retain_slash(format!("{}/{}", src_path, data_dir).as_str()).as_str(),
|
||||
)?;
|
||||
let dst_data_path = self.get_object_path(
|
||||
dst_volume,
|
||||
rustfs_utils::path::retain_slash(format!("{}/{}", &dst_path, data_dir).as_str()).as_str(),
|
||||
rustfs_utils::path::retain_slash(format!("{}/{}", dst_path, data_dir).as_str()).as_str(),
|
||||
)?;
|
||||
|
||||
Some((src_data_path, dst_data_path))
|
||||
@@ -6776,7 +6775,7 @@ impl DiskAPI for LocalDisk {
|
||||
// rename below to report through the existing rollback path. Payload
|
||||
// durability is kept by both strict and relaxed.
|
||||
// Bound to a local so the borrow lives across the join! below.
|
||||
let tmp_meta_rel_path = format!("{}/{}", &src_path, STORAGE_FORMAT_FILE);
|
||||
let tmp_meta_rel_path = format!("{}/{}", src_path, STORAGE_FORMAT_FILE);
|
||||
let tmp_meta_write =
|
||||
self.write_all_private(src_volume, &tmp_meta_rel_path, new_dst_buf.into(), tmp_meta_sync, src_file_parent);
|
||||
let shard_sync = async {
|
||||
@@ -6850,7 +6849,7 @@ impl DiskAPI for LocalDisk {
|
||||
&& let Err(err) = self
|
||||
.write_all_private(
|
||||
dst_volume,
|
||||
&format!("{}/{}/{}", &dst_path, &old_data_dir, STORAGE_FORMAT_FILE_BACKUP),
|
||||
&format!("{}/{}/{}", dst_path, old_data_dir, STORAGE_FORMAT_FILE_BACKUP),
|
||||
dst_buf.clone().into(),
|
||||
backup_sync,
|
||||
&skip_parent,
|
||||
@@ -7326,7 +7325,7 @@ impl DiskAPI for LocalDisk {
|
||||
check_path_length(file_path.to_string_lossy().as_ref())?;
|
||||
|
||||
let buf = self
|
||||
.read_all(volume, format!("{}/{}", &path, STORAGE_FORMAT_FILE).as_str())
|
||||
.read_all(volume, format!("{}/{}", path, STORAGE_FORMAT_FILE).as_str())
|
||||
.await
|
||||
.map_err(|e| {
|
||||
if e == DiskError::FileNotFound && fi.version_id.is_some() {
|
||||
@@ -7750,7 +7749,7 @@ impl DiskAPI for LocalDisk {
|
||||
let mut found = 0;
|
||||
|
||||
for v in req.files.iter() {
|
||||
let fpath = self.get_object_path(&req.bucket, format!("{}/{}", &req.prefix, v).as_str())?;
|
||||
let fpath = self.get_object_path(&req.bucket, format!("{}/{}", req.prefix, v).as_str())?;
|
||||
let mut res = ReadMultipleResp {
|
||||
bucket: req.bucket.clone(),
|
||||
prefix: req.prefix.clone(),
|
||||
@@ -12389,7 +12388,7 @@ mod test {
|
||||
.resolve_abs_path(Path::new(RUSTFS_META_TMP_DELETED_BUCKET))
|
||||
.expect("operation should succeed");
|
||||
|
||||
println!("ppp :{:?}", &tmpp);
|
||||
println!("ppp :{:?}", tmpp);
|
||||
|
||||
let volumes = vec!["a123", "b123", "c123"];
|
||||
|
||||
@@ -12413,7 +12412,7 @@ mod test {
|
||||
.resolve_abs_path(Path::new(RUSTFS_META_TMP_DELETED_BUCKET))
|
||||
.expect("operation should succeed");
|
||||
|
||||
println!("ppp :{:?}", &tmpp);
|
||||
println!("ppp :{:?}", tmpp);
|
||||
|
||||
let volumes = vec!["a123", "b123", "c123"];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user