mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 15:11:30 +00:00
8 lines
178 B
Rust
8 lines
178 B
Rust
// run-rustfix
|
|
#![warn(clippy::cast_abs_to_unsigned)]
|
|
|
|
fn main() {
|
|
let x: i32 = -42;
|
|
let y: u32 = x.abs() as u32;
|
|
println!("The absolute value of {} is {}", x, y);
|
|
}
|