Skip to content

Commit

Permalink
Deprecate unnecessary methods
Browse files Browse the repository at this point in the history
We implement a bunch of traits for getting at the inner field. Also, the
inner field is public. The `into_inner` and `as_inner` methods are just
clutter - deprecate them.
  • Loading branch information
tcharding committed Dec 29, 2024
1 parent 9d98410 commit b2070e6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,13 @@ impl<T> Ordered<T> {
/// 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 }
}

Expand Down

0 comments on commit b2070e6

Please sign in to comment.