Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate unneeded functions #28

Merged
merged 2 commits into from
Dec 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading