Skip to content

Commit 8654669

Browse files
authored
Update library/std/src/io/mod.rs
1 parent 316742e commit 8654669

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/std/src/io/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1392,10 +1392,10 @@ pub trait Write {
13921392
/// written, and a write which would otherwise block can be indicated through
13931393
/// an [`Err`] variant.
13941394
///
1395-
/// If the return value is [`Ok(n)`] then it must be guaranteed that `n <=
1396-
/// buf.len()`. Unless `input` is empty, this function shouldn’t return `0`
1397-
/// since caller may interpret that as an error (the default implementation
1398-
/// of [`Write::write_all`] does exactly that). To indicate lack of space
1395+
/// If this method consumed `n > 0` bytes of `buf` it must return [`Ok(n)`].
1396+
/// If the return value is `Ok(n)` it must hold than `n <= buf.len()`.
1397+
/// Unless `input` is empty, this function shouldn’t return `Ok(0)` since
1398+
/// caller may interpret that as an error. To indicate lack of space
13991399
/// function should return [`ErrorKind::StorageFull`] error instead.
14001400
///
14011401
/// # Errors

0 commit comments

Comments
 (0)