Skip to content

Commit

Permalink
Buf::uninitialized was an elaborate no-op; replace with mem::uninitia…
Browse files Browse the repository at this point in the history
…lized
  • Loading branch information
Dave Herman committed Apr 4, 2016
1 parent 588c88f commit d4e8021
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
8 changes: 0 additions & 8 deletions crates/neon-sys/src/buf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ pub struct Buf<'a> {
}

impl<'a> Buf<'a> {
pub unsafe fn uninitialized<'b>() -> Buf<'b> {
Buf {
ptr: mem::uninitialized(),
len: mem::uninitialized(),
marker: PhantomData
}
}

pub fn wrap(s: &'a str) -> Buf<'a> {
Buf {
ptr: s.as_ptr() as *mut u8,
Expand Down
3 changes: 2 additions & 1 deletion src/internal/js/binary.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::mem;
use vm::VmResult;
use internal::js::{Value, ValueInternal, Object, build};
use internal::mem::{Handle, Managed};
Expand Down Expand Up @@ -40,7 +41,7 @@ impl<'a> Lock for Handle<'a, JsBuffer> {
type Internals = Buf<'a>;

unsafe fn expose(self, state: &mut LockState) -> Self::Internals {
let mut result = Buf::uninitialized();
let mut result = mem::uninitialized();
neon_sys::buffer::data(&mut result, self.to_raw());
state.use_buffer(&result);
result
Expand Down

0 comments on commit d4e8021

Please sign in to comment.