mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-04 09:53:04 +03:00
Swap ptr::read for ptr::drop_in_place
This commit is contained in:
+1
-1
@@ -814,7 +814,7 @@ pub fn retain<F>(&mut self, mut f: F)
|
||||
if !f(&v[i]) {
|
||||
del += 1;
|
||||
unsafe {
|
||||
ptr::read(&v[i]);
|
||||
ptr::drop_in_place(&mut v[i]);
|
||||
}
|
||||
} else if del > 0 {
|
||||
let src: *const T = &v[i];
|
||||
|
||||
Reference in New Issue
Block a user