1
1
error: manual implementation of `abs` method
2
- --> tests/ui/floating_point_abs.rs:15 :5
2
+ --> tests/ui/floating_point_abs.rs:14 :5
3
3
|
4
4
LL | if num >= 0.0 { num } else { -num }
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.abs()`
@@ -8,43 +8,43 @@ LL | if num >= 0.0 { num } else { -num }
8
8
= help: to override `-D warnings` add `#[allow(clippy::suboptimal_flops)]`
9
9
10
10
error: manual implementation of `abs` method
11
- --> tests/ui/floating_point_abs.rs:19 :5
11
+ --> tests/ui/floating_point_abs.rs:18 :5
12
12
|
13
13
LL | if 0.0 < num { num } else { -num }
14
14
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.abs()`
15
15
16
16
error: manual implementation of `abs` method
17
- --> tests/ui/floating_point_abs.rs:23 :5
17
+ --> tests/ui/floating_point_abs.rs:22 :5
18
18
|
19
19
LL | if a.a > 0.0 { a.a } else { -a.a }
20
20
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `a.a.abs()`
21
21
22
22
error: manual implementation of `abs` method
23
- --> tests/ui/floating_point_abs.rs:27 :5
23
+ --> tests/ui/floating_point_abs.rs:26 :5
24
24
|
25
25
LL | if 0.0 >= num { -num } else { num }
26
26
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.abs()`
27
27
28
28
error: manual implementation of `abs` method
29
- --> tests/ui/floating_point_abs.rs:31 :5
29
+ --> tests/ui/floating_point_abs.rs:30 :5
30
30
|
31
31
LL | if a.a < 0.0 { -a.a } else { a.a }
32
32
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `a.a.abs()`
33
33
34
34
error: manual implementation of negation of `abs` method
35
- --> tests/ui/floating_point_abs.rs:35 :5
35
+ --> tests/ui/floating_point_abs.rs:34 :5
36
36
|
37
37
LL | if num < 0.0 { num } else { -num }
38
38
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-num.abs()`
39
39
40
40
error: manual implementation of negation of `abs` method
41
- --> tests/ui/floating_point_abs.rs:39 :5
41
+ --> tests/ui/floating_point_abs.rs:38 :5
42
42
|
43
43
LL | if 0.0 >= num { num } else { -num }
44
44
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-num.abs()`
45
45
46
46
error: manual implementation of negation of `abs` method
47
- --> tests/ui/floating_point_abs.rs:44 :12
47
+ --> tests/ui/floating_point_abs.rs:43 :12
48
48
|
49
49
LL | a: if a.a >= 0.0 { -a.a } else { a.a },
50
50
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-a.a.abs()`
0 commit comments