summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-06-06 19:06:56 +0200
committerLaurenz <laurmaedje@gmail.com>2023-06-06 19:06:56 +0200
commit219f14355b5df9a93210895d47f77b028291e788 (patch)
tree1d1a0549a3b49125ea7cd054cfc2e10b4c222c7b /src
parentf453565ebf061581f398eb3a5dcfb7a35a5ad04a (diff)
Rename `into_u16` to `as_u16`
Diffstat (limited to 'src')
-rw-r--r--src/syntax/source.rs2
-rw-r--r--src/syntax/span.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/syntax/source.rs b/src/syntax/source.rs
index f67ed656..277271db 100644
--- a/src/syntax/source.rs
+++ b/src/syntax/source.rs
@@ -282,7 +282,7 @@ impl SourceId {
}
/// Extract the underlying number.
- pub const fn into_u16(self) -> u16 {
+ pub const fn as_u16(self) -> u16 {
self.0
}
}
diff --git a/src/syntax/span.rs b/src/syntax/span.rs
index 0e4ec215..91e0a3cf 100644
--- a/src/syntax/span.rs
+++ b/src/syntax/span.rs
@@ -56,7 +56,7 @@ impl Span {
/// Pack the components into a span.
#[track_caller]
const fn pack(id: SourceId, number: u64) -> Span {
- let bits = ((id.into_u16() as u64) << Self::BITS) | number;
+ let bits = ((id.as_u16() as u64) << Self::BITS) | number;
match NonZeroU64::new(bits) {
Some(v) => Self(v),
None => panic!("span encoding is zero"),