Uh oh!
There was an error while loading. Please reload this page.
rustdoc: extend UdpSocket API doc (#657) - #44378
Conversation
rust-highfive
commented
Sep 6, 2017
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
frehberg
commented
Sep 6, 2017
@dtolnay please review |
mattico
left a comment
There was a problem hiding this comment.
Some ideas about the wording
There was a problem hiding this comment.
// Read a single message from the socket.
// If `buf` is too small to hold the message, it will be cut off.
There was a problem hiding this comment.
// create a slice into the buffer that's no longer than the received data
aidanhs
commented
Sep 7, 2017
dtolnay
left a comment
There was a problem hiding this comment.
Thanks! This is a nice improvement.
Both of my comments apply elsewhere in this PR as well.
There was a problem hiding this comment.
// Read a single message from the socket. If `buf` is too small to hold// the message, it will be cut off.letmut buf = [0;10];let(amt, src) = socket.recv_from(&mut buf)?;// send a reply to the socket we received data fromlet buf = &mut buf[..amt];// create a slice into the buffer that's// no longer than the received data
This feels jarring to me in that it uses a mix of sentence-case and lowercase, punctuation and no punctuation, and full line and end of line comments. Could you tidy this up to make it feel more consistent? Typically I prefer sentence-case, with punctuation, and comments without any code on the same line. But check the rest of this module because if everything else is consistently in a different style, let's follow that.
There was a problem hiding this comment.
Quoting from the documentation documentation:
The first line of a documentation comment should be a short summary of its functionality. One sentence. Just the basics. High level.
(I think by "line" they mean "paragraph" -- everything before the first blank line. The first paragraph is special in rustdoc. For example it is visible in the module-level documentation before you click through on the function.)
Everything you wrote is important to document but not all of it is high level basics. Could you split this into two paragraphs? The first one should give a general understanding of what the function does, and the second fills in the details.
frehberg
commented
Sep 8, 2017
Text has been modified, hope it fits now |
steveklabnik
commented
Sep 8, 2017
|
dtolnay
left a comment
There was a problem hiding this comment.
Almost looks good to me but please rephrase all three other comments to be consistent with the one I indicated. There are a few inconsistencies.
Read a single message from the socket
Receives a single datagram message from socket
Receives a single datagram message on the socket
Receives single datagram on the socket
... on success returning number of bytes
On success returning number of bytes
On success, returns the number of bytes
steveklabnik
commented
Sep 9, 2017
|
dtolnay
commented
Sep 10, 2017
I don't think #44378 (review) has been addressed yet. |
frehberg
commented
Sep 11, 2017
finally. Thanks for your patience |
steveklabnik
commented
Sep 11, 2017
No problem! Thanks for keeping with it! @bors: r+ rollup |
bors
commented
Sep 11, 2017
📌 Commit 04b8747 has been approved by |
dtolnay
commented
Sep 11, 2017
I don't think this sentence is grammatically correct -- just like "Going fishing" is not a complete sentence. I would prefer to word this (and the other ones similarly) like the one I indicated in #44378 (review):
@bors r- |
rustdoc: type-fixes
frehberg
commented
Sep 11, 2017
finally, finally |
frehberg
commented
Sep 14, 2017
Ready to merge? |
dtolnay
commented
Sep 14, 2017
@bors r+ rollup |
bors
commented
Sep 14, 2017
📌 Commit 85a9d97 has been approved by |
rustdoc: extend UdpSocket API doc (rust-lang#657) see tokio-rs/mio#657
see tokio-rs/mio#657