Apply rustfmt pass across all modules
Pure whitespace normalization — no logic changes. Mostly: - collapsing multi-line match/if arms rustfmt prefers inline - inlining short `with_context`/`ok_or_else` closures - reformatting nested method chains for consistency Build and clippy stay clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
+3
-6
@@ -43,13 +43,11 @@ fn systemctl(args: &[&str]) -> Result<()> {
|
||||
|
||||
/// Write the unit, reload systemd, and enable+start the service.
|
||||
pub fn install() -> Result<()> {
|
||||
let exe = std::env::current_exe()
|
||||
.context("Cannot determine path to own executable")?;
|
||||
let exe = std::env::current_exe().context("Cannot determine path to own executable")?;
|
||||
let path = unit_path()?;
|
||||
|
||||
if let Some(parent) = path.parent() {
|
||||
std::fs::create_dir_all(parent)
|
||||
.with_context(|| format!("Failed to create {parent:?}"))?;
|
||||
std::fs::create_dir_all(parent).with_context(|| format!("Failed to create {parent:?}"))?;
|
||||
}
|
||||
|
||||
let contents = render_unit(&exe);
|
||||
@@ -77,8 +75,7 @@ pub fn uninstall() -> Result<()> {
|
||||
let _ = systemctl(&["disable", "--now", UNIT_NAME]);
|
||||
|
||||
if path.exists() {
|
||||
std::fs::remove_file(&path)
|
||||
.with_context(|| format!("Failed to remove {path:?}"))?;
|
||||
std::fs::remove_file(&path).with_context(|| format!("Failed to remove {path:?}"))?;
|
||||
println!("Removed {}", path.display());
|
||||
} else {
|
||||
println!("No unit file at {}", path.display());
|
||||
|
||||
Reference in New Issue
Block a user