From 7ae0b8825a4e10e52a0eb3ed74655e695fcea61c Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 7 May 2024 18:28:41 -0700 Subject: [PATCH] Add `Ratio::into_raw` --- src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 0c54a0c..a9f3f73 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -84,6 +84,12 @@ impl Ratio { Ratio { numer, denom } } + /// Deconstructs a `Ratio` into its numerator and denominator. + #[inline] + pub fn into_raw(self) -> (T, T) { + (self.numer, self.denom) + } + /// Gets an immutable reference to the numerator. #[inline] pub const fn numer(&self) -> &T {