aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/rust-analyzer/src/line_endings.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/rust-analyzer/src/line_endings.rs b/crates/rust-analyzer/src/line_endings.rs
index 9f892f32e..bf0e255d9 100644
--- a/crates/rust-analyzer/src/line_endings.rs
+++ b/crates/rust-analyzer/src/line_endings.rs
@@ -46,7 +46,7 @@ impl LineEndings {
46 return (src, LineEndings::Dos); 46 return (src, LineEndings::Dos);
47 47
48 fn find_crlf(src: &[u8]) -> Option<usize> { 48 fn find_crlf(src: &[u8]) -> Option<usize> {
49 src.iter().zip(src.iter().skip(1)).position(|it| it == (&b'\r', &b'\n')) 49 src.windows(2).position(|it| it == b"\r\n")
50 } 50 }
51 } 51 }
52} 52}