Rollup merge of #38505 - estebank:why-lines, r=frewsxcv

Docs: Explain why/when `.lines()` returns an error

Fix #37744.
This commit is contained in:
Steve Klabnik 2016-12-24 14:29:26 -05:00 committed by GitHub
commit 3c26ff450c

View file

@ -1425,6 +1425,12 @@ pub trait BufRead: Read {
/// 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 }