]> git.lizzy.rs Git - rust.git/blobdiff - library/std/src/io/impls.rs
Add a `std::io::read_to_string` function
[rust.git] / library / std / src / io / impls.rs
index 6b3c86cb0df87ae176a17ecc30841279ed8aa241..00bf8b9af7384edcb567c256631b27c3b777644b 100644 (file)
@@ -306,6 +306,10 @@ fn consume(&mut self, amt: usize) {
 ///
 /// Note that writing updates the slice to point to the yet unwritten part.
 /// The slice will be empty when it has been completely overwritten.
+///
+/// If the number of bytes to be written exceeds the size of the slice, write operations will
+/// return short writes: ultimately, `Ok(0)`; in this situation, `write_all` returns an error of
+/// kind `ErrorKind::WriteZero`.
 #[stable(feature = "rust1", since = "1.0.0")]
 impl Write for &mut [u8] {
     #[inline]