From c52169f535f89c0300ec06e13ddcaa7e0f459a0b Mon Sep 17 00:00:00 2001 From: Jonas Maier Date: Mon, 1 Jun 2026 21:17:23 +0200 Subject: clippy --- src/parse/span.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/parse/span.rs') diff --git a/src/parse/span.rs b/src/parse/span.rs index 340a078..671c10d 100644 --- a/src/parse/span.rs +++ b/src/parse/span.rs @@ -22,6 +22,12 @@ impl FileId { } } +impl Default for FileId { + fn default() -> Self { + Self::new() + } +} + #[derive(Copy, Clone)] pub struct SpanFrom { pub file: FileId, @@ -52,15 +58,7 @@ pub struct Span { /// manual implementation of PartialOrd to ensure shorter Spans are first impl PartialOrd for Span { fn partial_cmp(&self, other: &Self) -> Option { - match self.file.partial_cmp(&other.file) { - Some(core::cmp::Ordering::Equal) => {} - ord => return ord, - } - match self.start.partial_cmp(&other.start) { - Some(core::cmp::Ordering::Equal) => {} - ord => return ord, - } - other.end.partial_cmp(&self.end) + Some(self.cmp(other)) } } -- cgit v1.2.3