summaryrefslogtreecommitdiff
path: root/crates/typst-syntax/src/file.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2024-10-27 19:04:55 +0100
committerGitHub <noreply@github.com>2024-10-27 18:04:55 +0000
commitbe7cfc85d08c545abfac08098b7b33b4bd71f37e (patch)
treef4137fa2aaa57babae1f7603a9b2ed7e688f43d8 /crates/typst-syntax/src/file.rs
parentb8034a343831e8609aec2ec81eb7eeda57aa5d81 (diff)
Split out four new crates (#5302)
Diffstat (limited to 'crates/typst-syntax/src/file.rs')
-rw-r--r--crates/typst-syntax/src/file.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/crates/typst-syntax/src/file.rs b/crates/typst-syntax/src/file.rs
index 89aaa55e..bc7dd314 100644
--- a/crates/typst-syntax/src/file.rs
+++ b/crates/typst-syntax/src/file.rs
@@ -97,12 +97,16 @@ impl FileId {
}
/// Construct from a raw number.
- pub(crate) const fn from_raw(v: u16) -> Self {
+ ///
+ /// Should only be used with numbers retrieved via
+ /// [`into_raw`](Self::into_raw). Misuse may results in panics, but no
+ /// unsafety.
+ pub const fn from_raw(v: u16) -> Self {
Self(v)
}
/// Extract the raw underlying number.
- pub(crate) const fn into_raw(self) -> u16 {
+ pub const fn into_raw(self) -> u16 {
self.0
}