Skip to content

Commit ea00198

Browse files
committed
fix: clippy::missing_errors_doc and clippy::double_must_use for from_tcp_rustls_with_timeouts
error: docs for function returning `Result` missing `# Errors` section --> packages/axum-server/src/custom_axum_server.rs:52:1 | 52 | pub fn from_tcp_rustls_with_timeouts(socket: TcpListener, tls: RustlsConfig) -> RustlsServerResult { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]` --> packages/axum-server/src/custom_axum_server.rs:52:1 | 52 | pub fn from_tcp_rustls_with_timeouts(socket: TcpListener, tls: RustlsConfig) -> RustlsServerResult { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Added documentation with Errors section and removed #[must_use] attribute since Result type already has it.
1 parent f0678be commit ea00198

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/axum-server/src/custom_axum_server.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ pub fn from_tcp_with_timeouts(socket: TcpListener) -> ServerResult {
5252
axum_server::from_tcp(socket).map(add_timeouts)
5353
}
5454

55-
#[must_use]
55+
/// Creates an Axum server from a TCP listener with TLS and configured timeouts.
56+
///
57+
/// # Errors
58+
///
59+
/// Returns an error if the server cannot be created from the TCP socket or if TLS configuration fails.
5660
pub fn from_tcp_rustls_with_timeouts(socket: TcpListener, tls: RustlsConfig) -> RustlsServerResult {
5761
axum_server::from_tcp_rustls(socket, tls).map(add_timeouts)
5862
}

0 commit comments

Comments
 (0)