about summary refs log tree commit diff
path: root/tvix/eval/src/source.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src/source.rs')
-rw-r--r--tvix/eval/src/source.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/tvix/eval/src/source.rs b/tvix/eval/src/source.rs
index 649679536080..5a7f10abb8da 100644
--- a/tvix/eval/src/source.rs
+++ b/tvix/eval/src/source.rs
@@ -19,11 +19,6 @@ use codemap::{CodeMap, Span};
 pub struct SourceCode(Rc<RefCell<CodeMap>>);
 
 impl SourceCode {
-    /// Create a new SourceCode instance.
-    pub fn new() -> Self {
-        SourceCode(Rc::new(RefCell::new(CodeMap::new())))
-    }
-
     /// Access a read-only reference to the codemap.
     pub fn codemap(&self) -> Ref<CodeMap> {
         self.0.borrow()
@@ -61,3 +56,10 @@ impl SourceCode {
         self.codemap().look_up_span(span).file
     }
 }
+
+impl Default for SourceCode {
+    /// Create a new SourceCode instance.
+    fn default() -> Self {
+        Self(Rc::new(RefCell::new(CodeMap::new())))
+    }
+}