You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most of the object creation and error validation is already done in Endpoint::new and as such Endpoint::connect_lazy should not be returning any errors since the connection is evaluated on-demand and cannot fail when building a channel. Meanwhile the API gives the wrong impression that the call may fail (does it ping the service beforehand? who knows)
Proposal
Change the return signature for connect_lazy to return the Channel to better indicate via API that this call can not fail due to connection errors.
Alternatives
Add a doc comment specifying that this function never fails when invoked.
The text was updated successfully, but these errors were encountered:
Yeah, this should have been fixed in 0.5. For now the API is unfalliable and unwraping there is safe from a panic. We should remove it for the next iteration.
Feature Request
Crates
transport
Motivation
Most of the object creation and error validation is already done in
Endpoint::new
and as suchEndpoint::connect_lazy
should not be returning any errors since the connection is evaluated on-demand and cannot fail when building a channel. Meanwhile the API gives the wrong impression that the call may fail (does it ping the service beforehand? who knows)Proposal
Change the return signature for
connect_lazy
to return theChannel
to better indicate via API that this call can not fail due to connection errors.Alternatives
Add a doc comment specifying that this function never fails when invoked.
The text was updated successfully, but these errors were encountered: