From 5363f350887b1e5b5dd21a86f88c8af9d7fea6da Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:25 +0200 Subject: Merging upstream version 1.67.1+dfsg1. Signed-off-by: Daniel Baumann --- vendor/rayon/src/str.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'vendor/rayon/src/str.rs') 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> { -- cgit v1.2.3