Make some docs nicer wrt pointer offsets
This commit is contained in:
parent
6c943bad02
commit
3ba393465f
4 changed files with 10 additions and 10 deletions
|
@ -542,8 +542,8 @@ impl<T> Vec<T> {
|
|||
///
|
||||
/// unsafe {
|
||||
/// // Overwrite memory with 4, 5, 6
|
||||
/// for i in 0..len as isize {
|
||||
/// ptr::write(p.offset(i), 4 + i);
|
||||
/// for i in 0..len {
|
||||
/// ptr::write(p.add(i), 4 + i);
|
||||
/// }
|
||||
///
|
||||
/// // Put everything back together into a Vec
|
||||
|
@ -702,8 +702,8 @@ impl<T, A: Allocator> Vec<T, A> {
|
|||
///
|
||||
/// unsafe {
|
||||
/// // Overwrite memory with 4, 5, 6
|
||||
/// for i in 0..len as isize {
|
||||
/// ptr::write(p.offset(i), 4 + i);
|
||||
/// for i in 0..len {
|
||||
/// ptr::write(p.add(i), 4 + i);
|
||||
/// }
|
||||
///
|
||||
/// // Put everything back together into a Vec
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue