Skip to content

Commit 1e892e2

Browse files
committed
Remove legacy default implementations
1 parent a2337f3 commit 1e892e2

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

src/real.rs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ pub trait Real
5656
///
5757
/// The default implementation will panic if `f32::EPSILON` cannot
5858
/// be cast to `Self`.
59-
fn epsilon() -> Self {
60-
Self::from(::std::f32::EPSILON).expect("Unable to cast from f32::EPSILON")
61-
}
59+
fn epsilon() -> Self;
6260

6361
/// Returns the largest finite value that this type can represent.
6462
///
@@ -412,12 +410,7 @@ pub trait Real
412410
///
413411
/// assert!(abs_difference < 1e-10);
414412
/// ```
415-
#[inline]
416-
fn to_degrees(self) -> Self {
417-
let halfpi = Self::zero().acos();
418-
let ninety = Self::from(90u8).unwrap();
419-
self * ninety / halfpi
420-
}
413+
fn to_degrees(self) -> Self;
421414

422415
/// Converts degrees to radians.
423416
///
@@ -430,12 +423,7 @@ pub trait Real
430423
///
431424
/// assert!(abs_difference < 1e-10);
432425
/// ```
433-
#[inline]
434-
fn to_radians(self) -> Self {
435-
let halfpi = Self::zero().acos();
436-
let ninety = Self::from(90u8).unwrap();
437-
self * halfpi / ninety
438-
}
426+
fn to_radians(self) -> Self;
439427

440428
/// Returns the maximum of the two numbers.
441429
///

0 commit comments

Comments
 (0)