Skip to content

Commit 0656d92

Browse files
committed
Fix clippy lints
1 parent 666a0ac commit 0656d92

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
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/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)