diff --git a/library/core/src/str/iter.rs b/library/core/src/str/iter.rs index 24083ee6af44f..f35ea624b688e 100644 --- a/library/core/src/str/iter.rs +++ b/library/core/src/str/iter.rs @@ -1093,6 +1093,14 @@ generate_pattern_iterators! { #[derive(Clone, Debug)] pub struct Lines<'a>(pub(super) Map, LinesAnyMap>); +impl<'a> Lines<'a> { + /// Returns the remaining lines that weren't iterated yet as one string slice. + #[unstable(feature = "str_lines_as_str", issue = "none")] + pub fn as_str(&self) -> &'a str { + self.0.iter.as_str() + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl<'a> Iterator for Lines<'a> { type Item = &'a str;