From 0dd4ae0a7ac0c247078df492469ff20b8a90c886 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sat, 21 Aug 2021 16:38:51 +0200 Subject: Prune derives --- src/source.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/source.rs') diff --git a/src/source.rs b/src/source.rs index 877fd729..b02af1b6 100644 --- a/src/source.rs +++ b/src/source.rs @@ -15,8 +15,7 @@ use crate::parse::{is_newline, Scanner}; use crate::util::PathExt; /// A unique identifier for a loaded source file. -#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)] -#[derive(Serialize, Deserialize)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash, Serialize, Deserialize)] pub struct SourceId(u32); impl SourceId { @@ -252,12 +251,6 @@ impl SourceFile { } } -impl AsRef for SourceFile { - fn as_ref(&self) -> &str { - &self.src - } -} - /// The indices at which lines start (right behind newlines). /// /// The beginning of the string (index 0) is not returned. @@ -276,6 +269,12 @@ fn newlines(string: &str) -> impl Iterator + '_ { }) } +impl AsRef for SourceFile { + fn as_ref(&self) -> &str { + &self.src + } +} + #[cfg(feature = "codespan-reporting")] impl<'a> Files<'a> for SourceStore { type FileId = SourceId; -- cgit v1.2.3