From 59b4916294d30af0c16a4737ff8d1e2077b589b5 Mon Sep 17 00:00:00 2001 From: Ariel Davis Date: Fri, 5 May 2023 17:25:10 -0700 Subject: [PATCH] Swap --- lib/line-index/src/lib.rs | 18 +++++++++--------- 1 file 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>, -} - /// 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>, +} + impl LineIndex { /// Returns a `LineIndex` for the `text`. pub fn new(text: &str) -> LineIndex {