Avoid infinite recursion on `no_std`
This commit is contained in:
parent
b7d2a99d09
commit
ba73ba2af0
|
@ -1268,16 +1268,30 @@ macro_rules! float_impl {
|
||||||
<$T>::log10(self)
|
<$T>::log10(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "std")]
|
||||||
#[inline]
|
#[inline]
|
||||||
fn to_degrees(self) -> Self {
|
fn to_degrees(self) -> Self {
|
||||||
<$T>::to_degrees(self)
|
<$T>::to_degrees(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "std")]
|
||||||
#[inline]
|
#[inline]
|
||||||
fn to_radians(self) -> Self {
|
fn to_radians(self) -> Self {
|
||||||
<$T>::to_radians(self)
|
<$T>::to_radians(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(feature = "std"))]
|
||||||
|
#[inline]
|
||||||
|
fn to_degrees(self) -> Self {
|
||||||
|
self * (180. / ::core::$T::consts::PI)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(not(feature = "std"))]
|
||||||
|
#[inline]
|
||||||
|
fn to_radians(self) -> Self {
|
||||||
|
self * (::core::$T::consts::PI / 180.)
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
#[inline]
|
#[inline]
|
||||||
fn max(self, other: Self) -> Self {
|
fn max(self, other: Self) -> Self {
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
html_root_url = "https://rust-num.github.io/num/",
|
html_root_url = "https://rust-num.github.io/num/",
|
||||||
html_playground_url = "http://play.integer32.com/")]
|
html_playground_url = "http://play.integer32.com/")]
|
||||||
|
|
||||||
|
#![deny(unconditional_recursion)]
|
||||||
|
|
||||||
#![cfg_attr(not(feature = "std"), no_std)]
|
#![cfg_attr(not(feature = "std"), no_std)]
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
extern crate core;
|
extern crate core;
|
||||||
|
|
Loading…
Reference in New Issue