Skip to content

Commit 68f4f68

Browse files
committed
gw: use or_panic instead of expect() to satisfy clippy
1 parent c3670be commit 68f4f68

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

gateway/src/proxy/port_attrs.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ use anyhow::{Context, Result};
2121
use dstack_guest_agent_rpc::dstack_guest_client::DstackGuestClient;
2222
use dstack_types::AppCompose;
2323
use http_client::prpc::PrpcClient;
24+
use or_panic::ResultOrPanic;
2425
use tokio::sync::mpsc::UnboundedReceiver;
2526
use tracing::{debug, warn};
2627

@@ -62,7 +63,7 @@ pub(crate) fn spawn_fetcher(state: Proxy, mut rx: UnboundedReceiver<String>) {
6263
// or unknown-instance), so a later registration with a new
6364
// compose_hash can re-trigger via the same path.
6465
{
65-
let mut in_flight = in_flight.lock().expect("port_attrs in_flight poisoned");
66+
let mut in_flight = in_flight.lock().or_panic("port_attrs in_flight poisoned");
6667
if !in_flight.insert(instance_id.clone()) {
6768
continue;
6869
}
@@ -74,7 +75,7 @@ pub(crate) fn spawn_fetcher(state: Proxy, mut rx: UnboundedReceiver<String>) {
7475
fetch_with_retry(&state, &id).await;
7576
in_flight
7677
.lock()
77-
.expect("port_attrs in_flight poisoned")
78+
.or_panic("port_attrs in_flight poisoned")
7879
.remove(&id);
7980
});
8081
}

0 commit comments

Comments
 (0)