-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Fix BufRead::read_until documentation. #36851
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
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
@@ -1270,10 +1270,6 @@ pub trait BufRead: Read { | |||
/// delimiter or EOF is found. Once found, all bytes up to, and including, | |||
/// the delimiter (if found) will be appended to `buf`. | |||
/// | |||
/// If this reader is currently at EOF then this function will not modify | |||
/// `buf` and will return `Ok(n)` where `n` is the number of bytes which | |||
/// were read. |
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.
Yes this is confusingly written, but it's the only place where the Ok return is mentioned, can we thus keep some kind of explanation of what the return value Ok(n)
means for this method?
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.
Added some actual description of successful return value, and done similar
change to read_line.
@bors r+ rollup Thanks |
📌 Commit 1e8f692 has been approved by |
Fix BufRead::read_until documentation. Second paragraph already fully explains what happens when EOF is encountered. The third paragraph (removed one) is spurious and misleading.
Second paragraph already fully explains what happens when EOF is
encountered. The third paragraph (removed one) is spurious and
misleading.