Skip to content
Permalink
Browse files

Use set_len

  • Loading branch information...
Zoxc committed Apr 1, 2019
1 parent 30e7e9c commit e8b3aea4d67c444a8704e39888eab37fc2b4cf95
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/libarena/lib.rs
@@ -239,7 +239,7 @@ impl<T> TypedArena<T> {
let len = vec.len();
let start_ptr = self.alloc_raw_slice(len);
vec.as_ptr().copy_to_nonoverlapping(start_ptr, len);
mem::forget(vec.drain());
vev.set_len(0);
slice::from_raw_parts_mut(start_ptr, len)
}
})
@@ -515,7 +515,7 @@ impl DroplessArena {
mem::align_of::<T>()
) as *mut _ as *mut T;
vec.as_ptr().copy_to_nonoverlapping(start_ptr, len);
mem::forget(vec.drain());
vev.set_len(0);
slice::from_raw_parts_mut(start_ptr, len)
}
})

0 comments on commit e8b3aea

Please sign in to comment.
You can’t perform that action at this time.