summaryrefslogtreecommitdiff
path: root/src/syntax/span.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-08-14 15:24:59 +0200
committerLaurenz <laurmaedje@gmail.com>2021-08-14 15:55:39 +0200
commit6ae6d86b9c6fefe6c5379ac1b20ea90634c09c81 (patch)
tree2504c3b46807be148b9efbadf9b23e57bb77b8f3 /src/syntax/span.rs
parentfcb4e451186067cdf6efe3c14cbfa7561b366a6c (diff)
Separate type for string values
Diffstat (limited to 'src/syntax/span.rs')
-rw-r--r--src/syntax/span.rs24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/syntax/span.rs b/src/syntax/span.rs
index cad9c5d5..e4a4fd32 100644
--- a/src/syntax/span.rs
+++ b/src/syntax/span.rs
@@ -142,18 +142,6 @@ impl Pos {
}
}
-impl From<u32> for Pos {
- fn from(index: u32) -> Self {
- Self(index)
- }
-}
-
-impl From<usize> for Pos {
- fn from(index: usize) -> Self {
- Self(index as u32)
- }
-}
-
impl Debug for Pos {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
Debug::fmt(&self.0, f)
@@ -171,6 +159,18 @@ where
}
}
+impl From<u32> for Pos {
+ fn from(index: u32) -> Self {
+ Self(index)
+ }
+}
+
+impl From<usize> for Pos {
+ fn from(index: usize) -> Self {
+ Self(index as u32)
+ }
+}
+
/// Convert a position or range into a span.
pub trait IntoSpan {
/// Convert into a span by providing the source id.