Skip to content

Commit 02e4339

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

File tree

1 file changed

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

1 file changed

+2
-0
lines changed

packages/axum-rest-tracker-api-server/src/server.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ impl Launcher {
269269
let running = Box::pin(async {
270270
match tls {
271271
Some(tls) => custom_axum_server::from_tcp_rustls_with_timeouts(socket, tls)
272+
.expect("Failed to create server from TCP socket with TLS")
272273
.handle(handle)
273274
// The TimeoutAcceptor is commented because TSL does not work with it.
274275
// See: https://github.com/torrust/torrust-index/issues/204#issuecomment-2115529214
@@ -277,6 +278,7 @@ impl Launcher {
277278
.await
278279
.expect("Axum server for tracker API crashed."),
279280
None => custom_axum_server::from_tcp_with_timeouts(socket)
281+
.expect("Failed to create server from TCP socket")
280282
.handle(handle)
281283
.acceptor(TimeoutAcceptor)
282284
.serve(router.into_make_service_with_connect_info::<std::net::SocketAddr>())

0 commit comments

Comments
 (0)