|
|
@ -227,10 +227,10 @@ impl<T> Iterator for RawValIter<T> {
|
|
|
|
unsafe {
|
|
|
|
unsafe {
|
|
|
|
let result = ptr::read(self.start);
|
|
|
|
let result = ptr::read(self.start);
|
|
|
|
self.start = if mem::size_of::<T>() == 0 {
|
|
|
|
self.start = if mem::size_of::<T>() == 0 {
|
|
|
|
(self.start as usize + 1) as *const _
|
|
|
|
(self.start as usize + 1) as *const _
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
self.start.offset(1)
|
|
|
|
self.start.offset(1)
|
|
|
|
};
|
|
|
|
};
|
|
|
|
Some(result)
|
|
|
|
Some(result)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -251,10 +251,10 @@ impl<T> DoubleEndedIterator for RawValIter<T> {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
unsafe {
|
|
|
|
unsafe {
|
|
|
|
self.end = if mem::size_of::<T>() == 0 {
|
|
|
|
self.end = if mem::size_of::<T>() == 0 {
|
|
|
|
(self.end as usize - 1) as *const _
|
|
|
|
(self.end as usize - 1) as *const _
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
self.end.offset(-1)
|
|
|
|
self.end.offset(-1)
|
|
|
|
};
|
|
|
|
};
|
|
|
|
Some(ptr::read(self.end))
|
|
|
|
Some(ptr::read(self.end))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|