Add must_use on copysign

Added a #[must_use] annotation on copysign, per review feedback.
This commit is contained in:
Raph Levien 2018-10-18 08:35:09 -07:00
parent 9a2e7026dc
commit f08db6bf1e
2 changed files with 2 additions and 0 deletions

View File

@ -221,6 +221,7 @@ impl f32 {
/// assert!(f32::NAN.copysign(1.0).is_nan());
/// ```
#[inline]
#[must_use]
#[unstable(feature="copysign", issue="55169")]
pub fn copysign(self, y: f32) -> f32 {
unsafe { intrinsics::copysignf32(self, y) }

View File

@ -199,6 +199,7 @@ impl f64 {
/// assert!(f64::NAN.copysign(1.0).is_nan());
/// ```
#[inline]
#[must_use]
#[unstable(feature="copysign", issue="55169")]
pub fn copysign(self, y: f64) -> f64 {
unsafe { intrinsics::copysignf64(self, y) }