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
I suggest changing the return type of listen() from (), the unit type to Result<!, ListenError>. This would better document what listen is supposed to do (i.e. never return, unless there was a error setting it up), and it would be more idiomatic Rust. Safe functions in Rust usually don't panic, with some exceptions (like an out of bounds index on an array). This would also require you to create some error type representing possible errors in executing listen.
It would be a breaking change, although pretty easy for users to fix - just change listen() to listen().unwrap() to get the old behavior.
The text was updated successfully, but these errors were encountered:
I suggest changing the return type of
listen()
from()
, the unit type toResult<!, ListenError>
. This would better document whatlisten
is supposed to do (i.e. never return, unless there was a error setting it up), and it would be more idiomatic Rust. Safe functions in Rust usually don't panic, with some exceptions (like an out of bounds index on an array). This would also require you to create some error type representing possible errors in executinglisten
.It would be a breaking change, although pretty easy for users to fix - just change
listen()
tolisten().unwrap()
to get the old behavior.The text was updated successfully, but these errors were encountered: