Skip to content

Commit 082a59d

Browse files
committed
Avoid unwrap
1 parent 51321f0 commit 082a59d

File tree

1 file changed

+3
-2
lines changed
  • crates/stackable-webhook/src/tls

1 file changed

+3
-2
lines changed

crates/stackable-webhook/src/tls/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! This module contains structs and functions to easily create a TLS termination
22
//! server, which can be used in combination with an Axum [`Router`].
3-
use std::{net::SocketAddr, sync::Arc};
3+
use std::{convert::Infallible, net::SocketAddr, sync::Arc};
44

55
use axum::{
66
Router,
@@ -169,7 +169,8 @@ impl TlsServer {
169169

170170
// Here, the connect info is extracted by calling Tower's Service
171171
// trait function on `IntoMakeServiceWithConnectInfo`
172-
let tower_service = router.call(remote_addr).await.unwrap();
172+
let tower_service: Result<_, Infallible> = router.call(remote_addr).await;
173+
let tower_service = tower_service.expect("Infallible error can never happen");
173174

174175
let span = tracing::debug_span!("accept tcp connection");
175176
tokio::spawn(async move {

0 commit comments

Comments
 (0)