Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions library/core/src/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1251,6 +1251,8 @@ impl str {
/// ending will return the same lines as an otherwise identical string
/// without a final line ending.
///
/// An empty string returns an empty iterator.
///
/// # Examples
///
/// Basic usage:
Expand Down Expand Up @@ -1281,6 +1283,15 @@ impl str {
///
/// assert_eq!(None, lines.next());
/// ```
///
/// An empty string returns an empty iterator:
///
/// ```
/// let text = "";
/// let mut lines = text.lines();
///
/// assert_eq!(lines.next(), None);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn lines(&self) -> Lines<'_> {
Expand Down
Loading