From 572c507c24ebaf2f8742e6fbf8d2a9050aa35af2 Mon Sep 17 00:00:00 2001 From: Ariel Davis Date: Mon, 4 Mar 2024 22:16:35 -0800 Subject: [PATCH] Derive more --- crates/text-pos/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/text-pos/src/lib.rs b/crates/text-pos/src/lib.rs index 9391953..8d0ef8a 100644 --- a/crates/text-pos/src/lib.rs +++ b/crates/text-pos/src/lib.rs @@ -131,7 +131,7 @@ impl PositionDb { } /// A pair of `(line, col)` for UTF-8. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] struct PositionUtf8 { /// Zero-based. line: u32, @@ -142,7 +142,7 @@ struct PositionUtf8 { /// A pair of start and end positions for UTF-8. /// /// `start` comes before `end`. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] struct RangeUtf8 { /// The start. start: PositionUtf8, @@ -151,7 +151,7 @@ struct RangeUtf8 { } /// A pair of `(line, col)` for UTF-16. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct PositionUtf16 { /// Zero-based. pub line: u32, @@ -168,7 +168,7 @@ impl fmt::Display for PositionUtf16 { /// A pair of start and end positions for UTF-16. /// /// `start` comes before `end`. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct RangeUtf16 { /// The start. pub start: PositionUtf16,