diff --git a/src/lib.rs b/src/lib.rs index d51cffa..81dc1ea 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -135,6 +135,18 @@ impl Ordered { /// This allows: `let found = map.get(Ordered::from_ref(&a));` #[allow(clippy::ptr_as_ptr)] pub fn from_ref(value: &T) -> &Self { unsafe { &*(value as *const _ as *const Self) } } + + /// Returns a reference to the inner object. + /// + /// We also implement [`core::borrow::Borrow`] so this function is never explicitly needed. + #[deprecated(since = "0.3.0", note = "use `ops::Deref` instead")] + pub const fn as_inner(&self) -> &T { &self.0 } + + /// Returns the inner object. + /// + /// We also implement [`core::ops::Deref`] so this function is never explicitly needed. + #[deprecated(since = "0.3.0", note = "use `ops::Deref` instead")] + pub fn into_inner(self) -> T { self.0 } } impl ArbitraryOrd for &T {