Skip to content

Commit 633cd84

Browse files
committed
usize is now a proper ctype, so fix cmp_slice
1 parent 8842e28 commit 633cd84

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

src/libcore/str/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1095,8 +1095,6 @@ fn eq_slice(a: &str, b: &str) -> bool {
10951095
/// faster than comparing each byte in a loop.
10961096
#[inline]
10971097
unsafe fn cmp_slice(a: &str, b: &str, len: usize) -> i32 {
1098-
// NOTE: In theory n should be libc::size_t and not usize, but libc is not available here
1099-
#[allow(improper_ctypes)]
11001098
extern { fn memcmp(s1: *const i8, s2: *const i8, n: usize) -> i32; }
11011099
memcmp(a.as_ptr() as *const i8, b.as_ptr() as *const i8, len)
11021100
}

0 commit comments

Comments
 (0)