diff --git a/crates/typst-syntax/src/lines.rs b/crates/typst-syntax/src/lines.rs index 6604339dd..046965ab6 100644 --- a/crates/typst-syntax/src/lines.rs +++ b/crates/typst-syntax/src/lines.rs @@ -230,6 +230,18 @@ impl Lines { } } +impl Hash for Lines { + fn hash(&self, state: &mut H) { + self.0.str.hash(state); + } +} + +impl> AsRef for Lines { + fn as_ref(&self) -> &str { + self.0.str.as_ref() + } +} + /// Create a line vector. fn lines(text: &str) -> Vec { std::iter::once(Line { byte_idx: 0, utf16_idx: 0 }) @@ -393,15 +405,3 @@ mod tests { test(TEST, 0..21, "", ""); } } - -impl Hash for Lines { - fn hash(&self, state: &mut H) { - self.0.str.hash(state); - } -} - -impl> AsRef for Lines { - fn as_ref(&self) -> &str { - self.0.str.as_ref() - } -}