summaryrefslogtreecommitdiff
path: root/src/source.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-11-14 14:53:01 +0100
committerLaurenz <laurmaedje@gmail.com>2021-11-14 15:06:34 +0100
commit8a38899c98b4f9829b2d1f21c8fee66d254d20c6 (patch)
treea3c611843cd515b39e6e42dcff9003b4ab60c42a /src/source.rs
parent14048937b877d242de8b585905cdab3ac6acd9ee (diff)
Tidying
Diffstat (limited to 'src/source.rs')
-rw-r--r--src/source.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/source.rs b/src/source.rs
index 85f48491..e692ac94 100644
--- a/src/source.rs
+++ b/src/source.rs
@@ -144,6 +144,11 @@ impl SourceFile {
}
}
+ /// Create a source file without a real id and path, usually for testing.
+ pub fn detached(src: impl Into<String>) -> Self {
+ Self::new(SourceId(0), Path::new(""), src.into())
+ }
+
/// The file's abstract syntax tree.
pub fn ast(&self) -> TypResult<Markup> {
let red = RedNode::from_root(self.root.clone(), self.id);
@@ -155,11 +160,6 @@ impl SourceFile {
}
}
- /// Create a source file without a real id and path, usually for testing.
- pub fn detached(src: impl Into<String>) -> Self {
- Self::new(SourceId(0), Path::new(""), src.into())
- }
-
/// The id of the source file.
pub fn id(&self) -> SourceId {
self.id