Skip to content

Commit

Permalink
Remove legacy default implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
yoanlcq committed Jan 18, 2018
1 parent a2337f3 commit 1e892e2
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions src/real.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ pub trait Real
///
/// The default implementation will panic if `f32::EPSILON` cannot
/// be cast to `Self`.
fn epsilon() -> Self {
Self::from(::std::f32::EPSILON).expect("Unable to cast from f32::EPSILON")
}
fn epsilon() -> Self;

/// Returns the largest finite value that this type can represent.
///
Expand Down Expand Up @@ -412,12 +410,7 @@ pub trait Real
///
/// assert!(abs_difference < 1e-10);
/// ```
#[inline]
fn to_degrees(self) -> Self {
let halfpi = Self::zero().acos();
let ninety = Self::from(90u8).unwrap();
self * ninety / halfpi
}
fn to_degrees(self) -> Self;

/// Converts degrees to radians.
///
Expand All @@ -430,12 +423,7 @@ pub trait Real
///
/// assert!(abs_difference < 1e-10);
/// ```
#[inline]
fn to_radians(self) -> Self {
let halfpi = Self::zero().acos();
let ninety = Self::from(90u8).unwrap();
self * halfpi / ninety
}
fn to_radians(self) -> Self;

/// Returns the maximum of the two numbers.
///
Expand Down

0 comments on commit 1e892e2

Please sign in to comment.