Skip to content

Commit 662e7cb

Browse files
committed
ci: fix clippy warning
1 parent 5f4500f commit 662e7cb

File tree

4 files changed

+10
-15
lines changed

4 files changed

+10
-15
lines changed

src/config_loader/config_persister.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,11 +489,11 @@ fn migrate_legacy_config(content: &str, config_path: &Path) -> Option<DorisConfi
489489
match toml::to_string_pretty(&new_config) {
490490
Ok(new_content) => {
491491
if let Err(e) = fs::write(config_path, new_content) {
492-
eprintln!("Warning: Failed to save migrated config: {}", e);
492+
eprintln!("Warning: Failed to save migrated config: {e}");
493493
}
494494
}
495495
Err(e) => {
496-
eprintln!("Warning: Failed to serialize migrated config: {}", e);
496+
eprintln!("Warning: Failed to serialize migrated config: {e}");
497497
}
498498
}
499499

@@ -544,7 +544,7 @@ pub fn load_persisted_config() -> Result<DorisConfig> {
544544

545545
match last_error {
546546
Some(e) => {
547-
eprintln!("Warning: {}", e);
547+
eprintln!("Warning: {e}");
548548
Ok(DorisConfig::default())
549549
}
550550
None => Ok(DorisConfig::default()),

src/config_loader/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ fn update_mixed_deployment(config: &mut DorisConfig) -> Result<()> {
244244

245245
fn persist_configuration(config: &DorisConfig) {
246246
if let Err(e) = config_persister::persist_config(config) {
247-
eprintln!("Warning: Failed to persist configuration: {}", e);
247+
eprintln!("Warning: Failed to persist configuration: {e}");
248248
}
249249
}
250250

@@ -425,8 +425,7 @@ pub fn get_config_path_mixed(env: Environment) -> Result<PathBuf> {
425425
}
426426

427427
Err(CliError::ConfigError(format!(
428-
"No {} installation found in mixed deployment",
429-
env
428+
"No {env} installation found in mixed deployment"
430429
)))
431430
}
432431

src/config_loader/process_detector.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ fn get_process_command_alternative(pid: u32) -> Result<String> {
137137
}
138138

139139
// If all else fails, try a different ps format
140-
let cmd = format!("ps -p {} -o args=", pid);
140+
let cmd = format!("ps -p {pid} -o args=");
141141
match execute_command(&cmd) {
142142
Ok(output) => Ok(output),
143143
Err(_) => {
@@ -226,15 +226,13 @@ fn read_proc_environ_by_pid(pid: u32, grep_pattern: &str) -> Result<String> {
226226
if proc_path.exists() {
227227
// Linux system
228228
let cmd = format!(
229-
"cat /proc/{}/environ | tr '\\0' '\\n' | grep -E '{}'",
230-
pid, grep_pattern
229+
"cat /proc/{pid}/environ | tr '\\0' '\\n' | grep -E '{grep_pattern}'"
231230
);
232231
execute_command(&cmd)
233232
} else {
234233
// If /proc doesn't exist or we can't access it
235234
Err(CliError::ConfigError(format!(
236-
"Cannot access process environment for PID {} - /proc filesystem not available",
237-
pid
235+
"Cannot access process environment for PID {pid} - /proc filesystem not available"
238236
)))
239237
}
240238
}
@@ -254,8 +252,7 @@ pub fn get_paths(env: Environment) -> Result<(PathBuf, PathBuf)> {
254252
// Extract DORIS_HOME and JAVA_HOME
255253
let doris_home = extract_env_var(&environ, "DORIS_HOME").ok_or_else(|| {
256254
CliError::ConfigError(format!(
257-
"DORIS_HOME not found in {} process environment",
258-
env
255+
"DORIS_HOME not found in {env} process environment"
259256
))
260257
})?;
261258

src/process.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ impl ProcessTool {
146146

147147
if !output.status.success() {
148148
return Err(CliError::ProcessExecutionFailed(format!(
149-
"Failed to get info for PID {}",
150-
pid
149+
"Failed to get info for PID {pid}"
151150
)));
152151
}
153152

0 commit comments

Comments
 (0)