2020-03-03 17:52:53 -06:00
|
|
|
error: manual implementation of `abs` method
|
2024-08-03 04:17:43 -05:00
|
|
|
--> tests/ui/floating_point_abs.rs:14:5
|
2020-02-28 14:40:13 -06:00
|
|
|
|
|
2021-03-12 08:30:50 -06:00
|
|
|
LL | if num >= 0.0 { num } else { -num }
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.abs()`
|
2020-02-28 14:40:13 -06:00
|
|
|
|
|
|
|
|
= note: `-D clippy::suboptimal-flops` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::suboptimal_flops)]`
|
2020-02-28 14:40:13 -06:00
|
|
|
|
2020-03-03 17:52:53 -06:00
|
|
|
error: manual implementation of `abs` method
|
2024-08-03 04:17:43 -05:00
|
|
|
--> tests/ui/floating_point_abs.rs:18:5
|
2020-02-29 15:46:59 -06:00
|
|
|
|
|
2021-03-12 08:30:50 -06:00
|
|
|
LL | if 0.0 < num { num } else { -num }
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.abs()`
|
2020-02-29 15:46:59 -06:00
|
|
|
|
2020-03-03 17:52:53 -06:00
|
|
|
error: manual implementation of `abs` method
|
2024-08-03 04:17:43 -05:00
|
|
|
--> tests/ui/floating_point_abs.rs:22:5
|
2020-02-29 15:46:59 -06:00
|
|
|
|
|
2021-03-12 08:30:50 -06:00
|
|
|
LL | if a.a > 0.0 { a.a } else { -a.a }
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `a.a.abs()`
|
2020-02-29 15:46:59 -06:00
|
|
|
|
2020-03-03 17:52:53 -06:00
|
|
|
error: manual implementation of `abs` method
|
2024-08-03 04:17:43 -05:00
|
|
|
--> tests/ui/floating_point_abs.rs:26:5
|
2020-02-29 15:46:59 -06:00
|
|
|
|
|
2021-03-12 08:30:50 -06:00
|
|
|
LL | if 0.0 >= num { -num } else { num }
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.abs()`
|
2020-02-29 15:46:59 -06:00
|
|
|
|
2020-03-03 17:52:53 -06:00
|
|
|
error: manual implementation of `abs` method
|
2024-08-03 04:17:43 -05:00
|
|
|
--> tests/ui/floating_point_abs.rs:30:5
|
2020-02-29 15:46:59 -06:00
|
|
|
|
|
2021-03-12 08:30:50 -06:00
|
|
|
LL | if a.a < 0.0 { -a.a } else { a.a }
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `a.a.abs()`
|
2020-02-29 15:46:59 -06:00
|
|
|
|
2020-03-03 17:52:53 -06:00
|
|
|
error: manual implementation of negation of `abs` method
|
2024-08-03 04:17:43 -05:00
|
|
|
--> tests/ui/floating_point_abs.rs:34:5
|
2020-02-29 15:46:59 -06:00
|
|
|
|
|
2021-03-12 08:30:50 -06:00
|
|
|
LL | if num < 0.0 { num } else { -num }
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-num.abs()`
|
2020-02-29 15:46:59 -06:00
|
|
|
|
2020-03-03 17:52:53 -06:00
|
|
|
error: manual implementation of negation of `abs` method
|
2024-08-03 04:17:43 -05:00
|
|
|
--> tests/ui/floating_point_abs.rs:38:5
|
2020-02-29 15:46:59 -06:00
|
|
|
|
|
2021-03-12 08:30:50 -06:00
|
|
|
LL | if 0.0 >= num { num } else { -num }
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-num.abs()`
|
2020-02-29 15:46:59 -06:00
|
|
|
|
2020-03-03 17:52:53 -06:00
|
|
|
error: manual implementation of negation of `abs` method
|
2024-08-03 04:17:43 -05:00
|
|
|
--> tests/ui/floating_point_abs.rs:43:12
|
2020-02-29 15:46:59 -06:00
|
|
|
|
|
2020-02-29 21:11:38 -06:00
|
|
|
LL | a: if a.a >= 0.0 { -a.a } else { a.a },
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-a.a.abs()`
|
2020-02-29 15:46:59 -06:00
|
|
|
|
|
|
|
error: aborting due to 8 previous errors
|
2020-02-28 14:40:13 -06:00
|
|
|
|