Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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(); | ~~~
- Loading branch information