From 7dc3bcd8ebcb5986a2cac353a195d5eaa35cb114 Mon Sep 17 00:00:00 2001 From: Tobias Schmitz Date: Tue, 20 May 2025 15:16:05 +0200 Subject: [PATCH] refactor: move impl blocks --- crates/typst-syntax/src/lines.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) 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() - } -}