File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 146
146
clippy:: redundant_pub_crate,
147
147
clippy:: option_if_let_else,
148
148
clippy:: ptr_as_ptr,
149
+ clippy:: ref_as_ptr,
149
150
clippy:: doc_markdown,
150
151
clippy:: semicolon_if_nothing_returned,
151
152
clippy:: if_not_else
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ impl<T> Iterator for Drain<'_, T> {
73
73
fn next ( & mut self ) -> Option < T > {
74
74
self . iter
75
75
. next ( )
76
- . map ( |elt| unsafe { ptr:: read ( elt as * const _ ) } )
76
+ . map ( |elt| unsafe { ptr:: read ( core :: ptr :: from_ref ( elt) ) } )
77
77
}
78
78
79
79
fn size_hint ( & self ) -> ( usize , Option < usize > ) {
@@ -86,7 +86,7 @@ impl<T> DoubleEndedIterator for Drain<'_, T> {
86
86
fn next_back ( & mut self ) -> Option < T > {
87
87
self . iter
88
88
. next_back ( )
89
- . map ( |elt| unsafe { ptr:: read ( elt as * const _ ) } )
89
+ . map ( |elt| unsafe { ptr:: read ( core :: ptr :: from_ref ( elt) ) } )
90
90
}
91
91
}
92
92
You can’t perform that action at this time.
0 commit comments