Skip to content

Commit ec5552f

Browse files
committed
chore: clippy cleanup ptr_eq
1 parent e4895d3 commit ec5552f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/sys/mman.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ pub unsafe fn mmap<F: AsFd>(
439439
libc::mmap(ptr, length.into(), prot.bits(), flags.bits(), fd, offset)
440440
};
441441

442-
if ret == libc::MAP_FAILED {
442+
if std::ptr::eq(ret, libc::MAP_FAILED) {
443443
Err(Errno::last())
444444
} else {
445445
// SAFETY: `libc::mmap` returns a valid non-null pointer or `libc::MAP_FAILED`, thus `ret`
@@ -471,7 +471,7 @@ pub unsafe fn mmap_anonymous(
471471
libc::mmap(ptr, length.into(), prot.bits(), flags.bits(), -1, 0)
472472
};
473473

474-
if ret == libc::MAP_FAILED {
474+
if std::ptr::eq(ret, libc::MAP_FAILED) {
475475
Err(Errno::last())
476476
} else {
477477
// SAFETY: `libc::mmap` returns a valid non-null pointer or `libc::MAP_FAILED`, thus `ret`
@@ -520,7 +520,7 @@ pub unsafe fn mremap(
520520
)
521521
};
522522

523-
if ret == libc::MAP_FAILED {
523+
if std::ptr::eq(ret, libc::MAP_FAILED) {
524524
Err(Errno::last())
525525
} else {
526526
// SAFETY: `libc::mremap` returns a valid non-null pointer or `libc::MAP_FAILED`, thus `ret`

0 commit comments

Comments
 (0)