Skip to content

Commit f1f3e6f

Browse files
authored
Merge pull request #28 from tcharding/12-30-deprecate
Deprecate unneeded functions
2 parents 760bbff + b2070e6 commit f1f3e6f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/lib.rs

+12
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,18 @@ impl<T> Ordered<T> {
135135
/// This allows: `let found = map.get(Ordered::from_ref(&a));`
136136
#[allow(clippy::ptr_as_ptr)]
137137
pub fn from_ref(value: &T) -> &Self { unsafe { &*(value as *const _ as *const Self) } }
138+
139+
/// Returns a reference to the inner object.
140+
///
141+
/// We also implement [`core::borrow::Borrow`] so this function is never explicitly needed.
142+
#[deprecated(since = "0.3.0", note = "use `ops::Deref` instead")]
143+
pub const fn as_inner(&self) -> &T { &self.0 }
144+
145+
/// Returns the inner object.
146+
///
147+
/// We also implement [`core::ops::Deref`] so this function is never explicitly needed.
148+
#[deprecated(since = "0.3.0", note = "use `ops::Deref` instead")]
149+
pub fn into_inner(self) -> T { self.0 }
138150
}
139151

140152
impl<T: ArbitraryOrd> ArbitraryOrd for &T {

0 commit comments

Comments
 (0)