Skip to content

Commit

Permalink
don't to_vec it
Browse files Browse the repository at this point in the history
  • Loading branch information
jupyterkat committed Sep 22, 2023
1 parent 2380547 commit 584beed
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/byondapi-rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ use crate::value::ByondValue;
/// # Safety
/// Don't pass in a null argv pointer please god
/// Just give this what BYOND gives you and pray for the best
pub unsafe fn parse_args(argc: byondapi_sys::u4c, argv: *mut ByondValue) -> Vec<ByondValue> {
unsafe { std::slice::from_raw_parts_mut(argv, argc as usize).to_vec() }
pub unsafe fn parse_args(
argc: byondapi_sys::u4c,
argv: *mut ByondValue,
) -> &'static mut [ByondValue] {
unsafe { std::slice::from_raw_parts_mut(argv, argc as usize) }
}

/// Re-export of byondapi_sys for all low level things you may run into.
Expand Down

0 comments on commit 584beed

Please sign in to comment.