-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
simplify std::io::Write::write rustdoc #62644
Conversation
The std::io::Write::write method currensly suggests consumers guaranteed that `0 <= n <= buf.len()`, for `Ok(n)`, however `n` is of type `usize` causing the compiler to emit a warning: ``` warning: comparison is useless due to type limits --> lib.rs:6:18 | 6 | Ok(n) => 0 <= n && n <= output.len(), | ^^^^^^ | = note: #[warn(unused_comparisons)] on by default ``` This PR removes the suggestion to check `0 <= n` since it is moot. r? @steveklabnik
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @steveklabnik (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
ping from triage @steveklabnik, could you review this PR? |
Sorry for taking so long here! @bors: r+ rollup |
📌 Commit e8e13f0 has been approved by |
simplify std::io::Write::write rustdoc The std::io::Write::write method currensly suggests consumers guaranteed that `0 <= n <= buf.len()`, for `Ok(n)`, however `n` is of type `usize` causing the compiler to emit a warning: ``` warning: comparison is useless due to type limits --> lib.rs:6:18 | 6 | Ok(n) => 0 <= n && n <= output.len(), | ^^^^^^ | = note: #[warn(unused_comparisons)] on by default ``` This PR removes the suggestion to check `0 <= n` since it is moot. r? @steveklabnik
simplify std::io::Write::write rustdoc The std::io::Write::write method currensly suggests consumers guaranteed that `0 <= n <= buf.len()`, for `Ok(n)`, however `n` is of type `usize` causing the compiler to emit a warning: ``` warning: comparison is useless due to type limits --> lib.rs:6:18 | 6 | Ok(n) => 0 <= n && n <= output.len(), | ^^^^^^ | = note: #[warn(unused_comparisons)] on by default ``` This PR removes the suggestion to check `0 <= n` since it is moot. r? @steveklabnik
Rollup of 8 pull requests Successful merges: - #62644 (simplify std::io::Write::write rustdoc) - #62971 (Add keywords item into the sidebar) - #63122 (Account for `maybe_whole_expr` in range patterns) - #63158 (Add test for issue-58951) - #63170 (cleanup StringReader fields) - #63179 (update test cases for vxWorks) - #63188 (Fix typos in release notes.) - #63191 (ci: fix toolstate not pushing data for Linux) Failed merges: r? @ghost
The std::io::Write::write method currensly suggests consumers guaranteed
that
0 <= n <= buf.len()
, forOk(n)
, howevern
is of typeusize
causing the compiler to emit a warning:
This PR removes the suggestion to check
0 <= n
since it is moot.r? @steveklabnik