summaryrefslogtreecommitdiff
path: root/crates/typst-syntax/src/path.rs
diff options
context:
space:
mode:
authorMyriad-Dreamin <35292584+Myriad-Dreamin@users.noreply.github.com>2024-07-14 21:14:21 +0800
committerGitHub <noreply@github.com>2024-07-14 13:14:21 +0000
commita3f3a1a83330e3fe9a686fbe4c0eda9f1e9e99b2 (patch)
tree0c6b10649101d75573e453498901907bdec5a8b3 /crates/typst-syntax/src/path.rs
parent4d8976b619fbb2ab19c1e46fccbca4294c0c2d0b (diff)
Change the signature of `World::main` (#4531)
Co-authored-by: Laurenz <laurmaedje@gmail.com>
Diffstat (limited to 'crates/typst-syntax/src/path.rs')
-rw-r--r--crates/typst-syntax/src/path.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/typst-syntax/src/path.rs b/crates/typst-syntax/src/path.rs
index b561128c..6c625642 100644
--- a/crates/typst-syntax/src/path.rs
+++ b/crates/typst-syntax/src/path.rs
@@ -85,6 +85,11 @@ impl VirtualPath {
Self::new(path)
}
}
+
+ /// The same path, but with a different extension.
+ pub fn with_extension(&self, extension: &str) -> Self {
+ Self(self.0.with_extension(extension))
+ }
}
impl Debug for VirtualPath {