Skip to content

Commit c6af92d

Browse files
supersurviveurtgross35
authored andcommitted
Change as cast to From since the conversion is lossless
1 parent 0963b7c commit c6af92d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler-builtins/src/mem/impls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ pub unsafe fn compare_bytes(s1: *const u8, s2: *const u8, n: usize) -> core::ffi
390390
let a = *s1.wrapping_add(i);
391391
let b = *s2.wrapping_add(i);
392392
if a != b {
393-
return a as core::ffi::c_int - b as core::ffi::c_int;
393+
return core::ffi::c_int::from(a) - core::ffi::c_int::from(b);
394394
}
395395
i += 1;
396396
}

0 commit comments

Comments
 (0)