Code formatting and quality improvements
- Apply cargo fmt to fix formatting issues - Fix clippy warning: remove nested format! calls in nginx reload error handling - Update Cargo.lock with version 1.2.8 - Improve code readability with proper multi-line formatting All code now passes: - cargo fmt --check ✅ - cargo clippy --all-targets --all-features -- -D warnings ✅
This commit is contained in:
Generated
+1
-1
@@ -291,7 +291,7 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
|
||||
|
||||
[[package]]
|
||||
name = "ddns_updater"
|
||||
version = "1.2.7"
|
||||
version = "1.2.8"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"chrono",
|
||||
|
||||
@@ -228,19 +228,29 @@ impl WebServerHandler for NginxHandler {
|
||||
|
||||
for (command, args) in &reload_methods {
|
||||
attempts += 1;
|
||||
eprintln!("Attempt {}: Trying {} {}", attempts, command, args.join(" "));
|
||||
|
||||
eprintln!(
|
||||
"Attempt {}: Trying {} {}",
|
||||
attempts,
|
||||
command,
|
||||
args.join(" ")
|
||||
);
|
||||
|
||||
match Command::new(command).args(args).output() {
|
||||
Ok(output) => {
|
||||
if output.status.success() {
|
||||
eprintln!("✅ Nginx reloaded successfully using: {} {}", command, args.join(" "));
|
||||
eprintln!(
|
||||
"✅ Nginx reloaded successfully using: {} {}",
|
||||
command,
|
||||
args.join(" ")
|
||||
);
|
||||
return Ok(());
|
||||
} else {
|
||||
let stderr = String::from_utf8_lossy(&output.stderr);
|
||||
let stdout = String::from_utf8_lossy(&output.stdout);
|
||||
last_error = format!(
|
||||
"Command '{}' failed with exit code {}: stderr: '{}', stdout: '{}'",
|
||||
format!("{} {}", command, args.join(" ")),
|
||||
"Command '{} {}' failed with exit code {}: stderr: '{}', stdout: '{}'",
|
||||
command,
|
||||
args.join(" "),
|
||||
output.status.code().unwrap_or(-1),
|
||||
stderr.trim(),
|
||||
stdout.trim()
|
||||
|
||||
Reference in New Issue
Block a user