Skip to content

Commit

Permalink
Merge pull request #28 from tcharding/12-30-deprecate
Browse files Browse the repository at this point in the history
Deprecate unneeded functions
  • Loading branch information
tcharding authored Dec 29, 2024
2 parents 760bbff + b2070e6 commit f1f3e6f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,18 @@ impl<T> Ordered<T> {
/// 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<T: ArbitraryOrd> ArbitraryOrd for &T {
Expand Down

0 comments on commit f1f3e6f

Please sign in to comment.