Add must_use on copysign
Added a #[must_use] annotation on copysign, per review feedback.
This commit is contained in:
parent
9a2e7026dc
commit
f08db6bf1e
2 changed files with 2 additions and 0 deletions
|
@ -221,6 +221,7 @@ impl f32 {
|
||||||
/// assert!(f32::NAN.copysign(1.0).is_nan());
|
/// assert!(f32::NAN.copysign(1.0).is_nan());
|
||||||
/// ```
|
/// ```
|
||||||
#[inline]
|
#[inline]
|
||||||
|
#[must_use]
|
||||||
#[unstable(feature="copysign", issue="55169")]
|
#[unstable(feature="copysign", issue="55169")]
|
||||||
pub fn copysign(self, y: f32) -> f32 {
|
pub fn copysign(self, y: f32) -> f32 {
|
||||||
unsafe { intrinsics::copysignf32(self, y) }
|
unsafe { intrinsics::copysignf32(self, y) }
|
||||||
|
|
|
@ -199,6 +199,7 @@ impl f64 {
|
||||||
/// assert!(f64::NAN.copysign(1.0).is_nan());
|
/// assert!(f64::NAN.copysign(1.0).is_nan());
|
||||||
/// ```
|
/// ```
|
||||||
#[inline]
|
#[inline]
|
||||||
|
#[must_use]
|
||||||
#[unstable(feature="copysign", issue="55169")]
|
#[unstable(feature="copysign", issue="55169")]
|
||||||
pub fn copysign(self, y: f64) -> f64 {
|
pub fn copysign(self, y: f64) -> f64 {
|
||||||
unsafe { intrinsics::copysignf64(self, y) }
|
unsafe { intrinsics::copysignf64(self, y) }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue