From 3dc71b2f5160ef9bd46143eed0edb5d2557b58e6 Mon Sep 17 00:00:00 2001 From: aur-build Date: Sun, 22 Nov 2026 10:36:24 +0000 Subject: rustfmt,lints: pin the formatting, adopt the idiom lints, pay them off rustfmt.toml fixes the shape the tree is written in (120 columns, small items kept on one line) and one canonical pass makes it the truth. [lints.clippy] names the idiom lints worth enforcing and leaves out the two that would add doc-comment boilerplate rather than remove it. The tree pays them off here: write!/writeln! instead of push_str(&format!()), let-else instead of match-on-Option, borrows where a thread entry point only reads what it owns, no `&self` on a Copy state and no `self` nobody reads. ops::to_prometheus gains one gauge helper: a metric's HELP, TYPE and value are now emitted by the same call instead of three. --- src/sandbox/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/sandbox/mod.rs') diff --git a/src/sandbox/mod.rs b/src/sandbox/mod.rs index bb6ab60..1c73e40 100644 --- a/src/sandbox/mod.rs +++ b/src/sandbox/mod.rs @@ -35,7 +35,7 @@ impl Cmd { self } pub fn name(&self) -> &str { - self.argv.first().map(String::as_str).unwrap_or("") + self.argv.first().map_or("", String::as_str) } } @@ -134,7 +134,7 @@ fn bound_listener(addr: &str, token: &str) -> Result { let key = (addr.to_string(), token.to_string()); // A poisoned registry means a panic in another thread's bind; the map is // still sound, so recover rather than wedge every later build. - let mut reg = registry.lock().unwrap_or_else(|p| p.into_inner()); + let mut reg = registry.lock().unwrap_or_else(std::sync::PoisonError::into_inner); if let Some(b) = reg.get(&key) { return Ok(b.clone()); } -- cgit v1.2.3