aboutsummaryrefslogtreecommitdiff
path: root/src/index.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/index.rs')
-rw-r--r--src/index.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/index.rs b/src/index.rs
index ab8e7416..149fd458 100644
--- a/src/index.rs
+++ b/src/index.rs
@@ -52,6 +52,18 @@ impl Ord for Point {
}
}
+impl From<Point<usize>> for Point<isize> {
+ fn from(point: Point<usize>) -> Self {
+ Point::new(point.line as isize, point.col)
+ }
+}
+
+impl From<Point<isize>> for Point<usize> {
+ fn from(point: Point<isize>) -> Self {
+ Point::new(point.line as usize, point.col)
+ }
+}
+
/// A line
///
/// Newtype to avoid passing values incorrectly