Skip to content

Commit 6bb5909

Browse files
committed
Fix clippy lints
1 parent 666a0ac commit 6bb5909

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

src/deque.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ impl<T, S: VecStorage<T> + ?Sized> DequeInner<T, S> {
926926
// as the two slices combined should be more than `len`.
927927
if len > front.len() {
928928
let begin = len - front.len();
929-
let drop_back = back.get_unchecked_mut(begin..) as *mut _;
929+
let drop_back = core::ptr::from_mut(back.get_unchecked_mut(begin..));
930930

931931
// Self::to_physical_index returns the index `len` units _after_ the front cursor,
932932
// meaning we can use it to find the decremented index for `back` for non-contiguous
@@ -939,8 +939,8 @@ impl<T, S: VecStorage<T> + ?Sized> DequeInner<T, S> {
939939
} else {
940940
// Otherwise, we know back's entire contents need to be dropped,
941941
// since the desired length never reaches into it.
942-
let drop_back = back as *mut _;
943-
let drop_front = front.get_unchecked_mut(len..) as *mut _;
942+
let drop_back = core::ptr::from_mut(back);
943+
let drop_front = core::ptr::from_mut(front.get_unchecked_mut(len..));
944944

945945
self.back = self.to_physical_index(len);
946946
self.full = false;

src/pool/arc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ mod tests {
542542

543543
let arc = MyArcPool.alloc(Zst4096).ok().unwrap();
544544

545-
let raw = &*arc as *const Zst4096;
545+
let raw = std::ptr::from_ref::<Zst4096>(&*arc);
546546
assert_eq!(0, raw as usize % 4096);
547547
}
548548
}

src/pool/boxed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ mod tests {
495495

496496
let boxed = MyBoxPool.alloc(Zst4096).ok().unwrap();
497497

498-
let raw = &*boxed as *const Zst4096;
498+
let raw = std::ptr::from_ref::<Zst4096>(&*boxed);
499499
assert_eq!(0, raw as usize % 4096);
500500
}
501501

src/pool/object.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ mod tests {
420420

421421
let object = MyObjectPool.request().unwrap();
422422

423-
let raw = &*object as *const Zst4096;
423+
let raw = std::ptr::from_ref::<Zst4096>(&*object);
424424
assert_eq!(0, raw as usize % 4096);
425425
}
426426
}

src/string/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ impl<LenT: LenType, S: StringStorage + ?Sized> StringInner<LenT, S> {
357357

358358
// Take out two simultaneous borrows. The &mut String won't be accessed
359359
// until iteration is over, in Drop.
360-
let self_ptr = self.as_mut_view() as *mut _;
360+
let self_ptr = core::ptr::from_mut(self.as_mut_view());
361361
// SAFETY: `slice::range` and `is_char_boundary` do the appropriate bounds checks.
362362
let chars_iter = unsafe { self.get_unchecked(start..end) }.chars();
363363

0 commit comments

Comments
 (0)