Skip to content

Commit 0548434

Browse files
committed
fix: E0599 and E0282 - no method named handle found for Result in axum-http-tracker-server
error[E0599]: no method named `handle` found for enum `std::result::Result<T, E>` in the current scope --> packages/axum-http-tracker-server/src/server.rs:77:22 | 76 | ... Some(tls) => custom_axum_server::from_tcp_rustls_with_timeouts(socket, tls) | ____________________- 77 | | ... .handle(handle) | |___________-^^^^^^ error[E0599]: no method named `handle` found for enum `std::result::Result<T, E>` in the current scope --> packages/axum-http-tracker-server/src/server.rs:85:22 | 84 | None => custom_axum_server::from_tcp_with_timeouts(socket) | _________________________- 85 | | .handle(handle) | |_____________________-^^^^^^ Added expect() calls to unwrap Result before calling handle() method for both TLS and non-TLS cases.
1 parent a217bb9 commit 0548434

File tree

1 file changed

+2
-0
lines changed
  • packages/axum-http-tracker-server/src

1 file changed

+2
-0
lines changed

packages/axum-http-tracker-server/src/server.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ impl Launcher {
7474
let running = Box::pin(async {
7575
match tls {
7676
Some(tls) => custom_axum_server::from_tcp_rustls_with_timeouts(socket, tls)
77+
.expect("Failed to create server from TCP socket with TLS")
7778
.handle(handle)
7879
// The TimeoutAcceptor is commented because TSL does not work with it.
7980
// See: https://github.com/torrust/torrust-index/issues/204#issuecomment-2115529214
@@ -82,6 +83,7 @@ impl Launcher {
8283
.await
8384
.expect("Axum server crashed."),
8485
None => custom_axum_server::from_tcp_with_timeouts(socket)
86+
.expect("Failed to create server from TCP socket")
8587
.handle(handle)
8688
.acceptor(TimeoutAcceptor)
8789
.serve(app.into_make_service_with_connect_info::<std::net::SocketAddr>())

0 commit comments

Comments
 (0)