Skip to content

Commit db5d697

Browse files
committed
std: impl of Write for &mut [u8]: document the buffer full error
Signed-off-by: Ian Jackson <[email protected]>
1 parent c4926d0 commit db5d697

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

library/std/src/io/impls.rs

+4
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,10 @@ impl BufRead for &[u8] {
306306
///
307307
/// Note that writing updates the slice to point to the yet unwritten part.
308308
/// The slice will be empty when it has been completely overwritten.
309+
///
310+
/// If the number of bytes to be written exceeds the size of the slice, write operations will
311+
/// return short writes: ultimately, `Ok(0)`; in this situation, `write_all` returns an error of
312+
/// kind `ErrorKind::WriteZero`.
309313
#[stable(feature = "rust1", since = "1.0.0")]
310314
impl Write for &mut [u8] {
311315
#[inline]

0 commit comments

Comments
 (0)