Rename LinesAnyMap to LinesMap
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>
This commit is contained in:
parent
2d46584fae
commit
0d8a0c56fe
2 changed files with 4 additions and 4 deletions
|
|
@ -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};
|
||||
|
|
@ -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> {
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -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 }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue