Skip to content
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

Merged
merged 3 commits into from
Jan 15, 2020

Conversation

Noah-Kennedy
Copy link
Contributor

@Noah-Kennedy Noah-Kennedy commented Jan 13, 2020

Minor change to alter documentation for send to no longer duplicate the documentation for send_to.
Fixes #652.

Copy link
Contributor

@spacekookie spacekookie left a 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.

@k-nasa k-nasa added the documentation Improvements or additions to documentation label Jan 14, 2020
///
/// let mut buf = vec![0; 1024];
/// let n = socket.recv(&mut buf).await?;
Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it

@spacekookie
Copy link
Contributor

spacekookie commented Jan 14, 2020 via email

Copy link
Contributor Author

@Noah-Kennedy Noah-Kennedy left a 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 the recv function?
    If its not, it should be

Error on my part. Should be fixed now

@k-nasa k-nasa changed the title Fixes https://github.com/async-rs/async-std/issues/652 Fix docs for UdpSocket::send Jan 15, 2020
Copy link
Member

@k-nasa k-nasa left a 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 😄

@k-nasa k-nasa merged commit 1071e82 into async-rs:master Jan 15, 2020
@Noah-Kennedy Noah-Kennedy deleted the udp-socket-send-doc branch January 15, 2020 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docs for UdpSocket::send have same example as send_to
3 participants