diff options
| author | Pietro Albini <pietro@pietroalbini.org> | 2019-08-01 16:00:22 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-01 16:00:22 +0200 |
| commit | 9ff52752d855722c55dbc71d9b22bd42eabfc468 (patch) | |
| tree | 8d643be7ee50ed26edcfdeca5ae0630e2a81b181 /src/libstd | |
| parent | a17951c4f80eb5208030f91fdb4ae93919fa6b12 (diff) | |
| parent | e8e13f04b2218fbc5faa9774a1b5bba9296f3389 (diff) | |
| download | rust-9ff52752d855722c55dbc71d9b22bd42eabfc468.tar.gz rust-9ff52752d855722c55dbc71d9b22bd42eabfc468.zip | |
Rollup merge of #62644 - arnottcr:std_io-doc, 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
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/io/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 09b6b694f7b..f89a7144437 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -1105,7 +1105,7 @@ pub trait Write { /// an [`Err`] variant. /// /// If the return value is [`Ok(n)`] then it must be guaranteed that - /// `0 <= n <= buf.len()`. A return value of `0` typically means that the + /// `n <= buf.len()`. A return value of `0` typically means that the /// underlying object is no longer able to accept bytes and will likely not /// be able to in the future as well, or that the buffer provided is empty. /// |
