fix:Apply suggestions from clippy 1.88

This commit is contained in:
houseme
2025-06-27 18:16:29 +08:00
parent 35489ea352
commit 749537664f
108 changed files with 642 additions and 682 deletions
+1 -2
View File
@@ -147,8 +147,7 @@ async fn heal_fresh_disk(endpoint: &Endpoint) -> Result<()> {
Some(disk) => disk,
None => {
return Err(Error::other(format!(
"Unexpected error disk must be initialized by now after formatting: {}",
endpoint
"Unexpected error disk must be initialized by now after formatting: {endpoint}"
)));
}
};
+1 -1
View File
@@ -487,7 +487,7 @@ impl CurrentScannerCycle {
Deserialize::deserialize(&mut Deserializer::new(&buf[..])).expect("Deserialization failed");
self.cycle_completed = u;
}
name => return Err(Error::other(format!("not support field name {}", name))),
name => return Err(Error::other(format!("not support field name {name}"))),
}
}
+1 -1
View File
@@ -372,7 +372,7 @@ impl ScannerMetrics {
for (disk, tracker) in paths.iter() {
let path = tracker.get_path().await;
result.push(format!("{}/{}", disk, path));
result.push(format!("{disk}/{path}"));
}
result
+3 -4
View File
@@ -318,7 +318,7 @@ impl HealSequence {
self.count_scanned(heal_type.clone()).await;
if source.no_wait {
let task_str = format!("{:?}", task);
let task_str = format!("{task:?}");
if GLOBAL_BackgroundHealRoutine.tasks_tx.try_send(task).is_ok() {
info!("Task in the queue: {:?}", task_str);
}
@@ -328,7 +328,7 @@ impl HealSequence {
let (resp_tx, mut resp_rx) = mpsc::channel(1);
task.resp_tx = Some(resp_tx);
let task_str = format!("{:?}", task);
let task_str = format!("{task:?}");
if GLOBAL_BackgroundHealRoutine.tasks_tx.try_send(task).is_ok() {
info!("Task in the queue: {:?}", task_str);
} else {
@@ -793,8 +793,7 @@ impl AllHealState {
for (k, v) in self.heal_seq_map.read().await.iter() {
if (has_prefix(k, path_s) || has_prefix(path_s, k)) && !v.has_ended().await {
return Err(Error::other(format!(
"The provided heal sequence path overlaps with an existing heal path: {}",
k
"The provided heal sequence path overlaps with an existing heal path: {k}"
)));
}
}