From f8a694267d3981b0437c05fc248406116ea9ec06 Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Tue, 18 Mar 2025 11:50:19 +1300 Subject: Large restructure Files were moved to be better organised, error messages were changed to be more general, and a Compiler type was added to the library. --- src/locators/source.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/locators') diff --git a/src/locators/source.rs b/src/locators/source.rs index 7e5abd2..15a0809 100644 --- a/src/locators/source.rs +++ b/src/locators/source.rs @@ -19,8 +19,16 @@ impl SourceSpan { } /// Wrap this source span around a child source span. - pub fn wrap(mut self, source: SourceSpan) -> Self { - self.child = Some(Box::new(source)); self + pub fn wrap(&self, child: impl Into) -> Self { + let mut new = self.clone(); + new.child = Some(Box::new(child.into())); + return new; + } +} + +impl From<&SourceSpan> for SourceSpan { + fn from(source: &SourceSpan) -> Self { + source.clone() } } -- cgit v1.2.3-70-g09d2