Skip to content

Commit fef7db2

Browse files
authored
Merge pull request #129 from cuviper/into_raw
Add `Ratio::into_raw`
2 parents 33c9385 + 7ae0b88 commit fef7db2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ impl<T> Ratio<T> {
8484
Ratio { numer, denom }
8585
}
8686

87+
/// Deconstructs a `Ratio` into its numerator and denominator.
88+
#[inline]
89+
pub fn into_raw(self) -> (T, T) {
90+
(self.numer, self.denom)
91+
}
92+
8793
/// Gets an immutable reference to the numerator.
8894
#[inline]
8995
pub const fn numer(&self) -> &T {

0 commit comments

Comments
 (0)