]> git.lizzy.rs Git - rust.git/blobdiff - crates/test_utils/src/lib.rs
internal: use API stabilized in 1.52
[rust.git] / crates / test_utils / src / lib.rs
index 72466c9570f9b4245fd1b6d6b2732f1c08fbab9b..fce4fd6bf2b9bbd1033e956259de25d0dc070f4d 100644 (file)
@@ -17,7 +17,7 @@
 };
 
 use profile::StopWatch;
-use stdx::{is_ci, lines_with_ends};
+use stdx::is_ci;
 use text_size::{TextRange, TextSize};
 
 pub use dissimilar::diff as __diff;
@@ -181,7 +181,7 @@ pub fn extract_annotations(text: &str) -> Vec<(TextRange, String)> {
     let mut prev_line_start: Option<TextSize> = None;
     let mut line_start: TextSize = 0.into();
     let mut prev_line_annotations: Vec<(TextSize, usize)> = Vec::new();
-    for line in lines_with_ends(text) {
+    for line in text.split_inclusive('\n') {
         let mut this_line_annotations = Vec::new();
         if let Some(idx) = line.find("//") {
             let annotation_offset = TextSize::of(&line[..idx + "//".len()]);