mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-13 23:36:29 +00:00
add Str.getUnsafe
This commit is contained in:
parent
2a82d24847
commit
1f943a5452
8 changed files with 28 additions and 53 deletions
|
@ -5468,8 +5468,17 @@ fn run_low_level<'a, 'ctx, 'env>(
|
|||
|
||||
list_prepend(env, original_wrapper, elem, elem_layout)
|
||||
}
|
||||
StrGetUnsafe => {
|
||||
// List.getUnsafe : List elem, Nat -> elem
|
||||
debug_assert_eq!(args.len(), 2);
|
||||
|
||||
let wrapper_struct = load_symbol(scope, &args[0]);
|
||||
let elem_index = load_symbol(scope, &args[1]);
|
||||
|
||||
call_bitcode_fn(env, &[wrapper_struct, elem_index], bitcode::STR_GET_UNSAFE)
|
||||
}
|
||||
ListGetUnsafe => {
|
||||
// List.get : List elem, Nat -> [Ok elem, OutOfBounds]*
|
||||
// List.getUnsafe : List elem, Nat -> elem
|
||||
debug_assert_eq!(args.len(), 2);
|
||||
|
||||
let (wrapper_struct, list_layout) = load_symbol_and_layout(scope, &args[0]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue