Skip to content

return values missing in try_bind #1107

@fala13

Description

@fala13

try_bind doesn't return anything, contrary to it's description and doesn't seem usable at all in current form.

warp/src/server.rs

Lines 182 to 203 in 1cbf029

/// Bind to a socket address, returning a `Future` that can be
/// executed on any runtime.
///
/// In case we are unable to bind to the specified address, resolves to an
/// error and logs the reason.
pub async fn try_bind(self, addr: impl Into<SocketAddr>) {
let addr = addr.into();
let srv = match try_bind!(self, &addr) {
Ok((_, srv)) => srv,
Err(err) => {
tracing::error!("error binding to {}: {}", addr, err);
return;
}
};
srv.map(|result| {
if let Err(err) = result {
tracing::error!("server error: {}", err)
}
})
.await;
}

should probably behave like try_bind_ephemeral
https://github.com/seanmonstar/warp/blob/master/src/server.rs#L227-L247

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions