From 21c81f237a4f93b64b11971f26c97982938b1d14 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sun, 28 Jan 2024 15:50:31 -0800 Subject: [PATCH] [core] Implement as_index() for range_bound_struct --- core/src/coordinates.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/coordinates.rs b/core/src/coordinates.rs index fd0d25e..7e4be53 100644 --- a/core/src/coordinates.rs +++ b/core/src/coordinates.rs @@ -90,6 +90,10 @@ macro_rules! range_bound_struct { $vis unsafe fn new_unchecked(x: $repr) -> Self { Self(x) } + + $vis fn as_index(&self) -> &$repr { + &self.0 + } } impl Into<$repr> for $type {