Skip to content

Commit 2c6c169

Browse files
committed
Fix clippy::ref_as_ptr warnings
1 parent 6db54e5 commit 2c6c169

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@
146146
clippy::redundant_pub_crate,
147147
clippy::option_if_let_else,
148148
clippy::ptr_as_ptr,
149+
clippy::ref_as_ptr,
149150
clippy::doc_markdown,
150151
clippy::semicolon_if_nothing_returned,
151152
clippy::if_not_else

src/vec/drain.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ impl<T> Iterator for Drain<'_, T> {
7373
fn next(&mut self) -> Option<T> {
7474
self.iter
7575
.next()
76-
.map(|elt| unsafe { ptr::read(elt as *const _) })
76+
.map(|elt| unsafe { ptr::read(core::ptr::from_ref(elt)) })
7777
}
7878

7979
fn size_hint(&self) -> (usize, Option<usize>) {
@@ -86,7 +86,7 @@ impl<T> DoubleEndedIterator for Drain<'_, T> {
8686
fn next_back(&mut self) -> Option<T> {
8787
self.iter
8888
.next_back()
89-
.map(|elt| unsafe { ptr::read(elt as *const _) })
89+
.map(|elt| unsafe { ptr::read(core::ptr::from_ref(elt)) })
9090
}
9191
}
9292

0 commit comments

Comments
 (0)