Let 'clamp' be invoked without using return value; used in tests
This commit is contained in:
parent
c5b0003d99
commit
54cb728ab8
2 changed files with 4 additions and 1 deletions
|
|
@ -1015,7 +1015,8 @@ impl f32 {
|
|||
/// assert!((2.0f32).clamp(-2.0, 1.0) == 1.0);
|
||||
/// assert!((std::f32::NAN).clamp(-2.0, 1.0).is_nan());
|
||||
/// ```
|
||||
#[must_use = "method returns a new number and does not mutate the original value"]
|
||||
// The tests below invoke `clamp` without a return value in order to cause a `panic`.
|
||||
// #[must_use = "method returns a new number and does not mutate the original value"]
|
||||
#[unstable(feature = "clamp", issue = "44095")]
|
||||
#[inline]
|
||||
pub fn clamp(self, min: f32, max: f32) -> f32 {
|
||||
|
|
|
|||
|
|
@ -936,6 +936,8 @@ impl f64 {
|
|||
/// assert!((2.0f64).clamp(-2.0, 1.0) == 1.0);
|
||||
/// assert!((std::f64::NAN).clamp(-2.0, 1.0).is_nan());
|
||||
/// ```
|
||||
// The tests below invoke `clamp` without a return value in order to cause a `panic`.
|
||||
// #[must_use = "method returns a new number and does not mutate the original value"]
|
||||
#[unstable(feature = "clamp", issue = "44095")]
|
||||
#[inline]
|
||||
pub fn clamp(self, min: f64, max: f64) -> f64 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue