Skip to content

Commit

Permalink
Rename LinesAnyMap to LinesMap
Browse files Browse the repository at this point in the history
lines_any method was replaced with lines method, so it
makes sense to rename this structure to match new name.

Co-authored-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
  • Loading branch information
KamilaBorowska and ijackson committed Oct 6, 2022
1 parent 2d46584 commit 0d8a0c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions library/core/src/str/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use super::from_utf8_unchecked;
use super::pattern::Pattern;
use super::pattern::{DoubleEndedSearcher, ReverseSearcher, Searcher};
use super::validations::{next_code_point, next_code_point_reverse};
use super::LinesAnyMap;
use super::LinesMap;
use super::{BytesIsNotEmpty, UnsafeBytesToStr};
use super::{CharEscapeDebugContinue, CharEscapeDefault, CharEscapeUnicode};
use super::{IsAsciiWhitespace, IsNotEmpty, IsWhitespace};
Expand Down Expand Up @@ -1091,7 +1091,7 @@ generate_pattern_iterators! {
#[stable(feature = "rust1", since = "1.0.0")]
#[must_use = "iterators are lazy and do nothing unless consumed"]
#[derive(Clone, Debug)]
pub struct Lines<'a>(pub(super) Map<SplitTerminator<'a, char>, LinesAnyMap>);
pub struct Lines<'a>(pub(super) Map<SplitTerminator<'a, char>, LinesMap>);

#[stable(feature = "rust1", since = "1.0.0")]
impl<'a> Iterator for Lines<'a> {
Expand Down
4 changes: 2 additions & 2 deletions library/core/src/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ impl str {
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn lines(&self) -> Lines<'_> {
Lines(self.split_terminator('\n').map(LinesAnyMap))
Lines(self.split_terminator('\n').map(LinesMap))
}

/// An iterator over the lines of a string.
Expand Down Expand Up @@ -2590,7 +2590,7 @@ impl Default for &mut str {
impl_fn_for_zst! {
/// A nameable, cloneable fn type
#[derive(Clone)]
struct LinesAnyMap impl<'a> Fn = |line: &'a str| -> &'a str {
struct LinesMap impl<'a> Fn = |line: &'a str| -> &'a str {
let l = line.len();
if l > 0 && line.as_bytes()[l - 1] == b'\r' { &line[0 .. l - 1] }
else { line }
Expand Down

0 comments on commit 0d8a0c5

Please sign in to comment.