summaryrefslogtreecommitdiffstats
path: root/vendor/rayon/src/str.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--vendor/rayon/src/str.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/vendor/rayon/src/str.rs b/vendor/rayon/src/str.rs
index 7afda3063..c85754e3d 100644
--- a/vendor/rayon/src/str.rs
+++ b/vendor/rayon/src/str.rs
@@ -689,11 +689,7 @@ pub struct Lines<'ch>(&'ch str);
#[inline]
fn no_carriage_return(line: &str) -> &str {
- if line.ends_with('\r') {
- &line[..line.len() - 1]
- } else {
- line
- }
+ line.strip_suffix('\r').unwrap_or(line)
}
impl<'ch> ParallelIterator for Lines<'ch> {