Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit eacee3c

Browse files
committedDec 19, 2024·
style: Use numeric constant
This solves clippy warnings like this: ``` error: usage of a legacy numeric method --> src/common.rs:418:31 | 418 | Number::from(i32::min_value()).as_i64(), | ^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants = note: `-D clippy::legacy-numeric-constants` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::legacy_numeric_constants)]` help: use the associated constant instead | 418 | Number::from(i32::MIN).as_i64(), | ~~~ ```
1 parent 4eb2275 commit eacee3c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎src/common.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -415,12 +415,12 @@ mod tests {
415415
assert_eq!(Number::from(1).as_i64(), Some(1));
416416
assert_eq!(Number::from(584).as_i64(), Some(584));
417417
assert_eq!(
418-
Number::from(i32::min_value()).as_i64(),
419-
Some(i32::min_value() as i64)
418+
Number::from(i32::MIN).as_i64(),
419+
Some(i32::MIN as i64)
420420
);
421421
assert_eq!(
422-
Number::from(i32::max_value()).as_i64(),
423-
Some(i32::max_value() as i64)
422+
Number::from(i32::MAX).as_i64(),
423+
Some(i32::MAX as i64)
424424
);
425425
}
426426

0 commit comments

Comments
 (0)
Please sign in to comment.