mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-10 23:26:53 +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:
@@ -2312,7 +2312,7 @@ pub fn gen_transition_objname(bucket: &str) -> Result<String, Error> {
|
||||
let mut hasher = Sha256::new();
|
||||
hasher.update(format!("{}/{}", runtime_sources::deployment_id().unwrap_or_default(), bucket).as_bytes());
|
||||
let hash = rustfs_utils::crypto::hex(hasher.finalize().as_slice());
|
||||
let obj = format!("{}/{}/{}/{}", &hash[0..16], &us[0..2], &us[2..4], &us);
|
||||
let obj = format!("{}/{}/{}/{}", &hash[0..16], &us[0..2], &us[2..4], us);
|
||||
Ok(obj)
|
||||
}
|
||||
|
||||
|
||||
@@ -250,10 +250,9 @@ pub async fn check_object_lock_for_deletion(
|
||||
let now = objectlock::utc_now_ntp();
|
||||
let retain_until = if let Some(days) = default_retention.days {
|
||||
mod_time.saturating_add(time::Duration::days(days as i64))
|
||||
} else if let Some(years) = default_retention.years {
|
||||
add_years(mod_time, years)
|
||||
} else {
|
||||
return None; // No retention period specified
|
||||
let years = default_retention.years?;
|
||||
add_years(mod_time, years)
|
||||
};
|
||||
|
||||
if retain_until.unix_timestamp() > now.unix_timestamp()
|
||||
|
||||
@@ -1405,7 +1405,7 @@ pub(crate) async fn schedule_replication_delete(dv: DeletedObjectReplicationInfo
|
||||
}
|
||||
|
||||
if let (Some(rs), Some(stats)) = (dv.delete_object.replication_state, runtime_sources::replication_stats()) {
|
||||
for (k, _v) in rs.targets.iter() {
|
||||
for k in rs.targets.keys() {
|
||||
let ri = ReplicatedTargetInfo {
|
||||
arn: k.clone(),
|
||||
size: 0,
|
||||
|
||||
@@ -1348,7 +1348,7 @@ pub async fn replicate_delete<S: ReplicationStorage>(dobj: DeletedObjectReplicat
|
||||
let mut join_set = JoinSet::new();
|
||||
|
||||
// Process each target
|
||||
for (_, tgt_entry) in dsc.targets_map.iter() {
|
||||
for tgt_entry in dsc.targets_map.values() {
|
||||
// Skip targets that should not be replicated
|
||||
if !tgt_entry.replicate {
|
||||
continue;
|
||||
|
||||
@@ -208,7 +208,7 @@ impl ReplicationStats {
|
||||
let now = SystemTime::now();
|
||||
|
||||
let cache_read = cache.read().await;
|
||||
for (_bucket, stats) in cache_read.iter() {
|
||||
for stats in cache_read.values() {
|
||||
for stat in stats.stats.values() {
|
||||
// Now we can update the moving averages using interior mutability
|
||||
stat.xfer_rate_lrg.measure.update_exponential_moving_average(now);
|
||||
|
||||
Reference in New Issue
Block a user