Switch loading file chunks to list of bytes instead of string

This commit is contained in:
Brendan Hansknecht 2021-10-03 14:56:09 -07:00
parent 3943ff9ffd
commit 75eccf5bac
4 changed files with 5 additions and 6 deletions

View file

@ -171,7 +171,7 @@ pub fn roc_fx_getFileLine(br_ptr: *mut BufReader<File>) -> RocStr {
}
#[no_mangle]
pub fn roc_fx_getFileBytes(br_ptr: *mut BufReader<File>) -> RocStr {
pub fn roc_fx_getFileBytes(br_ptr: *mut BufReader<File>) -> RocList<u8> {
let br = unsafe { &mut *br_ptr };
let mut buffer = [0; 0x10 /* This is intentially small to ensure correct implementation */];
@ -179,7 +179,7 @@ pub fn roc_fx_getFileBytes(br_ptr: *mut BufReader<File>) -> RocStr {
.read(&mut buffer[..])
.expect("Failed to read bytes from file");
RocStr::from_slice(&buffer[..count])
RocList::from_slice(&buffer[..count])
}
#[no_mangle]