Skip to content

Commit

Permalink
soundness(neon): Require T: 'static on JsArrayBuffer::external an…
Browse files Browse the repository at this point in the history
…d `JsBuffer::external`

Fixes #896
  • Loading branch information
kjvalencik committed May 23, 2022
1 parent 779f733 commit 4e350ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/types/buffer/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl JsBuffer {
pub fn external<'a, C, T>(cx: &mut C, data: T) -> Handle<'a, Self>
where
C: Context<'a>,
T: AsMut<[u8]> + Send,
T: AsMut<[u8]> + Send + 'static,
{
let env = cx.env().to_raw();
let value = unsafe { neon_runtime::buffer::new_external(env, data) };
Expand Down Expand Up @@ -151,7 +151,7 @@ impl JsArrayBuffer {
pub fn external<'a, C, T>(cx: &mut C, data: T) -> Handle<'a, Self>
where
C: Context<'a>,
T: AsMut<[u8]> + Send,
T: AsMut<[u8]> + Send + 'static,
{
let env = cx.env().to_raw();
let value = unsafe { neon_runtime::arraybuffer::new_external(env, data) };
Expand Down

0 comments on commit 4e350ea

Please sign in to comment.