Skip to content

Commit

Permalink
Change code for into_iter on the RawVec section for consistency/s…
Browse files Browse the repository at this point in the history
…oundness (#302)
  • Loading branch information
zachmatson authored Aug 27, 2021
1 parent 0c7e5bd commit 8da31d7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/vec/vec-raw.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,12 @@ impl<T> Vec<T> {
IntoIter {
start: buf.ptr.as_ptr(),
end: buf.ptr.as_ptr().add(len),
end: if buf.cap == 0 {
// can't offset off of a pointer unless it's part of an allocation
buf.ptr.as_ptr()
} else {
buf.ptr.as_ptr().add(len)
},
_buf: buf,
}
}
Expand Down

0 comments on commit 8da31d7

Please sign in to comment.