Skip to content

Instantly share code, notes, and snippets.

@FreeMasen
Created August 30, 2019 16:26
Show Gist options
  • Save FreeMasen/2402971f93ffbf85b5eddba2feed1bcb to your computer and use it in GitHub Desktop.
Save FreeMasen/2402971f93ffbf85b5eddba2feed1bcb to your computer and use it in GitHub Desktop.
fn slice_to_uint9_array(slice: &[u8]) -> UInt8Array {
let mut ret = UInt8Array::new_with_length(slice.len());
for (i, x) in slice.iter().enumerate() {
ret.set(i, x);
}
ret
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment