]> git.lizzy.rs Git - rust.git/commitdiff
Docs: Explain why/when `.lines()` returns an error
authorEsteban Küber <esteban@kuber.com.ar>
Wed, 21 Dec 2016 01:09:36 +0000 (17:09 -0800)
committerEsteban Küber <esteban@kuber.com.ar>
Wed, 21 Dec 2016 01:09:36 +0000 (17:09 -0800)
src/libstd/io/mod.rs

index b07da0dc268c481f5ef73a11d6a2d817f64165da..6ba614fa2e3a35bf2b5b766daa7223abfcf0f2b8 100644 (file)
@@ -1425,6 +1425,12 @@ fn split(self, byte: u8) -> Split<Self> where Self: Sized {
     ///     println!("{}", line.unwrap());
     /// }
     /// ```
+    ///
+    /// # Errors
+    ///
+    /// Each line of the iterator has the same error semantics as [`BufRead::read_line()`].
+    ///
+    /// [`BufRead::read_line()`]: trait.BufRead.html#method.read_line
     #[stable(feature = "rust1", since = "1.0.0")]
     fn lines(self) -> Lines<Self> where Self: Sized {
         Lines { buf: self }