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:
funman300
2026-04-17 21:35:27 -07:00
parent e72ee69c14
commit 1bacf345f0
7 changed files with 83 additions and 119 deletions
+3 -6
View File
@@ -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());