Skip to content

Commit

Permalink
wip, clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
andrieshiemstra committed Jan 7, 2024
1 parent 45c553e commit 9dc5ad4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/quickjs_utils/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ pub unsafe fn to_bytecode(
q::JS_WRITE_OBJ_BYTECODE as i32,
);

let slice = std::slice::from_raw_parts(slice_u8, len as usize);
let slice = std::slice::from_raw_parts(slice_u8, len as _);
// it's a shame to copy the vec here but the alternative is to create a wrapping struct which free's the ptr on drop
let ret = slice.to_vec();
q::js_free(context, slice_u8 as *mut c_void);
Expand Down
2 changes: 1 addition & 1 deletion src/quickjs_utils/typedarrays.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ pub unsafe fn detach_array_buffer_buffer(

let ptr = q::JS_GetArrayBuffer(ctx, &mut len, *array_buffer.borrow_value());

Vec::from_raw_parts(ptr, len as usize, len as _)
Vec::from_raw_parts(ptr, len as _, len as _)
};

q::JS_DetachArrayBuffer(ctx, *array_buffer.borrow_value());
Expand Down

0 comments on commit 9dc5ad4

Please sign in to comment.