Commit 0baba28
committed
Resolve legacy_numeric_constants clippy lints
warning: usage of a legacy numeric method
--> src/de.rs:484:73
|
484 | ... if overflow!(significand * 10 + digit, u64::max_value()) {
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
= note: `#[warn(clippy::legacy_numeric_constants)]` on by default
help: use the associated constant instead
|
484 | if overflow!(significand * 10 + digit, u64::MAX) {
| ~~~
warning: usage of a legacy numeric method
--> src/de.rs:536:57
|
536 | if overflow!(significand * 10 + digit, u64::max_value()) {
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
536 | if overflow!(significand * 10 + digit, u64::MAX) {
| ~~~
warning: usage of a legacy numeric method
--> src/de.rs:600:49
|
600 | if overflow!(exp * 10 + digit, i32::max_value()) {
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
600 | if overflow!(exp * 10 + digit, i32::MAX) {
| ~~~
warning: usage of a legacy numeric method
--> src/number.rs:100:39
|
100 | N::PosInt(v) => v <= i64::max_value() as u64,
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
100 | N::PosInt(v) => v <= i64::MAX as u64,
| ~~~
warning: usage of a legacy numeric method
--> src/number.rs:192:30
|
192 | if n <= i64::max_value() as u64 {
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
192 | if n <= i64::MAX as u64 {
| ~~~
warning: usage of a legacy numeric method
--> tests/../src/lexical/exponent.rs:11:21
|
11 | if value > i32::max_value() as usize {
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
= note: `#[warn(clippy::legacy_numeric_constants)]` on by default
help: use the associated constant instead
|
11 | if value > i32::MAX as usize {
| ~~~
warning: usage of a legacy numeric method
--> tests/../src/lexical/exponent.rs:12:14
|
12 | i32::max_value()
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
12 | i32::MAX
| ~~~
warning: usage of a legacy numeric method
--> tests/../src/lexical/rounding.rs:28:14
|
28 | u64::max_value()
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
28 | u64::MAX
| ~~~
warning: usage of a legacy numeric method
--> tests/lexical/exponent.rs:21:34
|
21 | scientific_exponent(i32::min_value(), 0, 0),
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
21 | scientific_exponent(i32::MIN, 0, 0),
| ~~~
warning: usage of a legacy numeric method
--> tests/lexical/exponent.rs:22:14
|
22 | i32::min_value()
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
22 | i32::MIN
| ~~~
warning: usage of a legacy numeric method
--> tests/lexical/exponent.rs:25:34
|
25 | scientific_exponent(i32::min_value(), 0, 5),
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
25 | scientific_exponent(i32::MIN, 0, 5),
| ~~~
warning: usage of a legacy numeric method
--> tests/lexical/exponent.rs:26:14
|
26 | i32::min_value()
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
26 | i32::MIN
| ~~~
warning: usage of a legacy numeric method
--> tests/lexical/exponent.rs:31:34
|
31 | scientific_exponent(i32::max_value(), 0, 0),
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
31 | scientific_exponent(i32::MAX, 0, 0),
| ~~~
warning: usage of a legacy numeric method
--> tests/lexical/exponent.rs:32:14
|
32 | i32::max_value() - 1
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
32 | i32::MAX - 1
| ~~~
warning: usage of a legacy numeric method
--> tests/lexical/exponent.rs:35:34
|
35 | scientific_exponent(i32::max_value(), 5, 0),
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
35 | scientific_exponent(i32::MAX, 5, 0),
| ~~~
warning: usage of a legacy numeric method
--> tests/lexical/exponent.rs:36:14
|
36 | i32::max_value()
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
36 | i32::MAX
| ~~~
warning: usage of a legacy numeric method
--> tests/lexical/exponent.rs:45:32
|
45 | mantissa_exponent(i32::max_value(), 5, 0),
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
45 | mantissa_exponent(i32::MAX, 5, 0),
| ~~~
warning: usage of a legacy numeric method
--> tests/lexical/exponent.rs:46:14
|
46 | i32::max_value() - 5
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
46 | i32::MAX - 5
| ~~~
warning: usage of a legacy numeric method
--> tests/lexical/exponent.rs:48:39
|
48 | assert_eq!(mantissa_exponent(i32::max_value(), 0, 5), i32::max_value());
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
48 | assert_eq!(mantissa_exponent(i32::MAX, 0, 5), i32::max_value());
| ~~~
warning: usage of a legacy numeric method
--> tests/lexical/exponent.rs:48:64
|
48 | assert_eq!(mantissa_exponent(i32::max_value(), 0, 5), i32::max_value());
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
48 | assert_eq!(mantissa_exponent(i32::max_value(), 0, 5), i32::MAX);
| ~~~
warning: usage of a legacy numeric method
--> tests/lexical/exponent.rs:49:39
|
49 | assert_eq!(mantissa_exponent(i32::min_value(), 5, 0), i32::min_value());
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
49 | assert_eq!(mantissa_exponent(i32::MIN, 5, 0), i32::min_value());
| ~~~
warning: usage of a legacy numeric method
--> tests/lexical/exponent.rs:49:64
|
49 | assert_eq!(mantissa_exponent(i32::min_value(), 5, 0), i32::min_value());
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
49 | assert_eq!(mantissa_exponent(i32::min_value(), 5, 0), i32::MIN);
| ~~~
warning: usage of a legacy numeric method
--> tests/lexical/exponent.rs:51:32
|
51 | mantissa_exponent(i32::min_value(), 0, 5),
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
51 | mantissa_exponent(i32::MIN, 0, 5),
| ~~~
warning: usage of a legacy numeric method
--> tests/lexical/exponent.rs:52:14
|
52 | i32::min_value() + 5
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
52 | i32::MIN + 5
| ~~~
warning: importing legacy numeric constants
--> tests/test.rs:47:11
|
47 | use std::{i16, i32, i64, i8};
| ^^^
|
= help: remove this import
= note: then `i16::<CONST>` will resolve to the respective associated constant
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
= note: `#[warn(clippy::legacy_numeric_constants)]` on by default
warning: importing legacy numeric constants
--> tests/test.rs:47:16
|
47 | use std::{i16, i32, i64, i8};
| ^^^
|
= help: remove this import
= note: then `i32::<CONST>` will resolve to the respective associated constant
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
warning: importing legacy numeric constants
--> tests/test.rs:47:21
|
47 | use std::{i16, i32, i64, i8};
| ^^^
|
= help: remove this import
= note: then `i64::<CONST>` will resolve to the respective associated constant
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
warning: importing legacy numeric constants
--> tests/test.rs:47:26
|
47 | use std::{i16, i32, i64, i8};
| ^^
|
= help: remove this import
= note: then `i8::<CONST>` will resolve to the respective associated constant
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
warning: importing legacy numeric constants
--> tests/test.rs:48:11
|
48 | use std::{u16, u32, u64, u8};
| ^^^
|
= help: remove this import
= note: then `u16::<CONST>` will resolve to the respective associated constant
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
warning: importing legacy numeric constants
--> tests/test.rs:48:16
|
48 | use std::{u16, u32, u64, u8};
| ^^^
|
= help: remove this import
= note: then `u32::<CONST>` will resolve to the respective associated constant
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
warning: importing legacy numeric constants
--> tests/test.rs:48:21
|
48 | use std::{u16, u32, u64, u8};
| ^^^
|
= help: remove this import
= note: then `u64::<CONST>` will resolve to the respective associated constant
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
warning: importing legacy numeric constants
--> tests/test.rs:48:26
|
48 | use std::{u16, u32, u64, u8};
| ^^
|
= help: remove this import
= note: then `u8::<CONST>` will resolve to the respective associated constant
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
warning: usage of a legacy numeric constant
--> tests/test.rs:161:22
|
161 | let v = to_value(::std::f64::NAN.copysign(1.0)).unwrap();
| ^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
161 | let v = to_value(f64::NAN.copysign(1.0)).unwrap();
| ~~~~~~~~
warning: usage of a legacy numeric constant
--> tests/test.rs:164:22
|
164 | let v = to_value(::std::f64::NAN.copysign(-1.0)).unwrap();
| ^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
164 | let v = to_value(f64::NAN.copysign(-1.0)).unwrap();
| ~~~~~~~~
warning: usage of a legacy numeric constant
--> tests/test.rs:167:22
|
167 | let v = to_value(::std::f64::INFINITY).unwrap();
| ^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
167 | let v = to_value(f64::INFINITY).unwrap();
| ~~~~~~~~~~~~~
warning: usage of a legacy numeric constant
--> tests/test.rs:170:23
|
170 | let v = to_value(-::std::f64::INFINITY).unwrap();
| ^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
170 | let v = to_value(-f64::INFINITY).unwrap();
| ~~~~~~~~~~~~~
warning: usage of a legacy numeric constant
--> tests/test.rs:173:22
|
173 | let v = to_value(::std::f32::NAN.copysign(1.0)).unwrap();
| ^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
173 | let v = to_value(f32::NAN.copysign(1.0)).unwrap();
| ~~~~~~~~
warning: usage of a legacy numeric constant
--> tests/test.rs:176:22
|
176 | let v = to_value(::std::f32::NAN.copysign(-1.0)).unwrap();
| ^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
176 | let v = to_value(f32::NAN.copysign(-1.0)).unwrap();
| ~~~~~~~~
warning: usage of a legacy numeric constant
--> tests/test.rs:179:22
|
179 | let v = to_value(::std::f32::INFINITY).unwrap();
| ^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
179 | let v = to_value(f32::INFINITY).unwrap();
| ~~~~~~~~~~~~~
warning: usage of a legacy numeric constant
--> tests/test.rs:182:23
|
182 | let v = to_value(-::std::f32::INFINITY).unwrap();
| ^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
182 | let v = to_value(-f32::INFINITY).unwrap();
| ~~~~~~~~~~~~~
warning: usage of a legacy numeric method
--> tests/test.rs:2243:26
|
2243 | let signed = &[i128::min_value(), -1, 0, 1, i128::max_value()];
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
2243 | let signed = &[i128::MIN, -1, 0, 1, i128::max_value()];
| ~~~
warning: usage of a legacy numeric method
--> tests/test.rs:2243:55
|
2243 | let signed = &[i128::min_value(), -1, 0, 1, i128::max_value()];
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
2243 | let signed = &[i128::min_value(), -1, 0, 1, i128::MAX];
| ~~~
warning: usage of a legacy numeric method
--> tests/test.rs:2244:34
|
2244 | let unsigned = &[0, 1, u128::max_value()];
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
2244 | let unsigned = &[0, 1, u128::MAX];
| ~~~
warning: usage of a legacy numeric method
--> tests/test.rs:2280:36
|
2280 | let signed = &[i128::from(i64::min_value()), i128::from(u64::max_value())];
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
2280 | let signed = &[i128::from(i64::MIN), i128::from(u64::max_value())];
| ~~~
warning: usage of a legacy numeric method
--> tests/test.rs:2280:66
|
2280 | let signed = &[i128::from(i64::min_value()), i128::from(u64::max_value())];
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
2280 | let signed = &[i128::from(i64::min_value()), i128::from(u64::MAX)];
| ~~~
warning: usage of a legacy numeric method
--> tests/test.rs:2281:41
|
2281 | let unsigned = &[0, u128::from(u64::max_value())];
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
2281 | let unsigned = &[0, u128::from(u64::MAX)];
| ~~~
warning: usage of a legacy numeric method
--> tests/test.rs:2294:44
|
2294 | let err = to_value(u128::from(u64::max_value()) + 1).unwrap_err();
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
2294 | let err = to_value(u128::from(u64::MAX) + 1).unwrap_err();
| ~~~1 parent b1ebf38 commit 0baba28
File tree
6 files changed
+32
-52
lines changed- src
- lexical
- tests
- lexical
6 files changed
+32
-52
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
481 | 481 | | |
482 | 482 | | |
483 | 483 | | |
484 | | - | |
| 484 | + | |
485 | 485 | | |
486 | 486 | | |
487 | 487 | | |
| |||
533 | 533 | | |
534 | 534 | | |
535 | 535 | | |
536 | | - | |
| 536 | + | |
537 | 537 | | |
538 | 538 | | |
539 | 539 | | |
| |||
597 | 597 | | |
598 | 598 | | |
599 | 599 | | |
600 | | - | |
| 600 | + | |
601 | 601 | | |
602 | 602 | | |
603 | 603 | | |
| |||
789 | 789 | | |
790 | 790 | | |
791 | 791 | | |
792 | | - | |
| 792 | + | |
793 | 793 | | |
794 | 794 | | |
795 | 795 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
| 11 | + | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
| 180 | + | |
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
| 192 | + | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 20 | + | |
| 21 | + | |
28 | 22 | | |
29 | 23 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 24 | + | |
| 25 | + | |
38 | 26 | | |
39 | 27 | | |
40 | 28 | | |
41 | 29 | | |
42 | 30 | | |
43 | 31 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
54 | 36 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | 47 | | |
50 | 48 | | |
51 | 49 | | |
| |||
158 | 156 | | |
159 | 157 | | |
160 | 158 | | |
161 | | - | |
| 159 | + | |
162 | 160 | | |
163 | 161 | | |
164 | | - | |
| 162 | + | |
165 | 163 | | |
166 | 164 | | |
167 | | - | |
| 165 | + | |
168 | 166 | | |
169 | 167 | | |
170 | | - | |
| 168 | + | |
171 | 169 | | |
172 | 170 | | |
173 | | - | |
| 171 | + | |
174 | 172 | | |
175 | 173 | | |
176 | | - | |
| 174 | + | |
177 | 175 | | |
178 | 176 | | |
179 | | - | |
| 177 | + | |
180 | 178 | | |
181 | 179 | | |
182 | | - | |
| 180 | + | |
183 | 181 | | |
184 | 182 | | |
185 | 183 | | |
| |||
2240 | 2238 | | |
2241 | 2239 | | |
2242 | 2240 | | |
2243 | | - | |
2244 | | - | |
| 2241 | + | |
| 2242 | + | |
2245 | 2243 | | |
2246 | 2244 | | |
2247 | 2245 | | |
| |||
2277 | 2275 | | |
2278 | 2276 | | |
2279 | 2277 | | |
2280 | | - | |
2281 | | - | |
| 2278 | + | |
| 2279 | + | |
2282 | 2280 | | |
2283 | 2281 | | |
2284 | 2282 | | |
| |||
2291 | 2289 | | |
2292 | 2290 | | |
2293 | 2291 | | |
2294 | | - | |
| 2292 | + | |
2295 | 2293 | | |
2296 | 2294 | | |
2297 | 2295 | | |
| |||
0 commit comments