Skip to content

Commit f5834a7

Browse files
authored
inout: use core::ptr::eq (#1175)
Fixes the `clippy::ptr_eq` lint.
1 parent 845657e commit f5834a7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

inout/src/inout.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl<'inp, 'out, T> InOut<'inp, 'out, T> {
4343
where
4444
T: Copy,
4545
{
46-
if self.in_ptr != self.out_ptr {
46+
if !core::ptr::eq(self.in_ptr, self.out_ptr) {
4747
unsafe {
4848
ptr::copy(self.in_ptr, self.out_ptr, 1);
4949
}

inout/src/inout_buf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl<'inp, 'out, T> InOutBuf<'inp, 'out, T> {
131131
where
132132
T: Copy,
133133
{
134-
if self.in_ptr != self.out_ptr {
134+
if !core::ptr::eq(self.in_ptr, self.out_ptr) {
135135
unsafe {
136136
core::ptr::copy(self.in_ptr, self.out_ptr, self.len);
137137
}

0 commit comments

Comments
 (0)