File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
crates/oxc_ecmascript/src Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ pub trait ToInt32 {
88}
99
1010impl ToInt32 for f64 {
11- #[ expect( clippy:: float_cmp, clippy:: cast_possible_truncation, clippy:: cast_possible_wrap) ]
1211 fn to_int_32 ( & self ) -> i32 {
1312 #[ cfg( target_arch = "aarch64" ) ]
1413 {
@@ -43,6 +42,7 @@ fn f64_to_int32_arm64(number: f64) -> i32 {
4342
4443/// Generic implementation of ToInt32 for non-ARM64 architectures
4544#[ cfg( not( target_arch = "aarch64" ) ) ]
45+ #[ expect( clippy:: float_cmp, clippy:: cast_possible_truncation, clippy:: cast_possible_wrap) ]
4646fn f64_to_int32_generic ( number : f64 ) -> i32 {
4747 const SIGN_MASK : u64 = 0x8000_0000_0000_0000 ;
4848 const EXPONENT_MASK : u64 = 0x7FF0_0000_0000_0000 ;
@@ -118,6 +118,7 @@ pub trait ToUint32 {
118118}
119119
120120impl ToUint32 for f64 {
121+ #[ expect( clippy:: cast_sign_loss) ]
121122 fn to_uint_32 ( & self ) -> u32 {
122123 self . to_int_32 ( ) as u32
123124 }
@@ -128,6 +129,7 @@ mod test {
128129 use super :: * ;
129130
130131 #[ test]
132+ #[ expect( clippy:: cast_precision_loss) ]
131133 fn f64_to_int32_conversion ( ) {
132134 assert_eq ! ( 0.0_f64 . to_int_32( ) , 0 ) ;
133135 assert_eq ! ( ( -0.0_f64 ) . to_int_32( ) , 0 ) ;
You can’t perform that action at this time.
0 commit comments