Rustonomicon: Reword potentially confusing comment in Vec::drain.

pull/10/head
Jørn Lode 9 years ago committed by Manish Goregaokar
parent 2574990a3f
commit a0b4fdad02

@ -132,7 +132,7 @@ impl<T> Vec<T> {
unsafe { unsafe {
let iter = RawValIter::new(&self); let iter = RawValIter::new(&self);
// this is a mem::forget safety thing. If this is forgotten, we just // this is a mem::forget safety thing. If Drain is forgotten, we just
// leak the whole Vec's contents. Also we need to do this *eventually* // leak the whole Vec's contents. Also we need to do this *eventually*
// anyway, so why not do it now? // anyway, so why not do it now?
self.len = 0; self.len = 0;

@ -158,7 +158,7 @@ impl<T> Vec<T> {
unsafe { unsafe {
let iter = RawValIter::new(&self); let iter = RawValIter::new(&self);
// this is a mem::forget safety thing. If this is forgotten, we just // this is a mem::forget safety thing. If Drain is forgotten, we just
// leak the whole Vec's contents. Also we need to do this *eventually* // leak the whole Vec's contents. Also we need to do this *eventually*
// anyway, so why not do it now? // anyway, so why not do it now?
self.len = 0; self.len = 0;

Loading…
Cancel
Save