diff options
| author | aur-build <aur-build@localhost> | 2026-11-22 10:36:24 +0000 |
|---|---|---|
| committer | aur-build <aur-build@localhost> | 2026-11-22 10:36:24 +0000 |
| commit | 3dc71b2f5160ef9bd46143eed0edb5d2557b58e6 (patch) | |
| tree | 7cc7169181b4bdd73fd8817f8c1d7cce6e6998a8 /src/sandbox/mod.rs | |
| parent | 9dc9087d89891c6e5ef7e5dc084dd13c8611843e (diff) | |
| download | aur-build-3dc71b2f5160ef9bd46143eed0edb5d2557b58e6.tar.gz aur-build-3dc71b2f5160ef9bd46143eed0edb5d2557b58e6.zip | |
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.
Diffstat (limited to 'src/sandbox/mod.rs')
| -rw-r--r-- | src/sandbox/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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<Bound> { 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()); } |
