-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix docs for UdpSocket::send #671
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a good example.
I've actually been thinking about this myself, because some of the udp module examples were a bit unpolished. It's propably a good approach to create a more complete example in the module docs, then have each function doc only highlight how that function is actually useful, instead of trying to do half in either examples.
src/net/udp/mod.rs
Outdated
/// | ||
/// let mut buf = vec![0; 1024]; | ||
/// let n = socket.recv(&mut buf).await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove recv
call?
Is this an example of the recv
function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. It looks like I put the docs in the wrong spot. I'll correct that issue right now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed it
- /// let mut buf = vec![0; 1024];
- /// let n = socket.recv(&mut buf).await?;
Why remove `recv` call?
Is this an example of the `recv` function?
If its not, it should be
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- /// let mut buf = vec![0; 1024]; - /// let n = socket.recv(&mut buf).await?; Why remove
recv
call? Is this an example of therecv
function?
If its not, it should be
Error on my part. Should be fixed now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!
@Noah-Kennedy Thanks 😄
Minor change to alter documentation for
send
to no longer duplicate the documentation forsend_to
.Fixes #652.