Unnamed repository; edit this file 'description' to name the repository.
Ariel Davis 2023-05-06
parent 663e11c · commit 59b4916
-rw-r--r--lib/line-index/src/lib.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/line-index/src/lib.rs b/lib/line-index/src/lib.rs
index e31f3006e2..61f907f060 100644
--- a/lib/line-index/src/lib.rs
+++ b/lib/line-index/src/lib.rs
@@ -9,15 +9,6 @@ use nohash_hasher::IntMap;
pub use text_size::{TextRange, TextSize};
-/// Maps flat [`TextSize`] offsets into `(line, column)` representation.
-#[derive(Clone, Debug, PartialEq, Eq)]
-pub struct LineIndex {
- /// Offset the beginning of each line, zero-based.
- newlines: Box<[TextSize]>,
- /// List of non-ASCII characters on each line.
- line_wide_chars: IntMap<u32, Box<[WideChar]>>,
-}
-
/// Line/Column information in native, utf8 format.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub struct LineCol {
@@ -77,6 +68,15 @@ impl WideChar {
}
}
+/// Maps flat [`TextSize`] offsets into `(line, column)` representation.
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub struct LineIndex {
+ /// Offset the beginning of each line, zero-based.
+ newlines: Box<[TextSize]>,
+ /// List of non-ASCII characters on each line.
+ line_wide_chars: IntMap<u32, Box<[WideChar]>>,
+}
+
impl LineIndex {
/// Returns a `LineIndex` for the `text`.
pub fn new(text: &str) -> LineIndex {