Str.reserve

This commit is contained in:
Folkert 2022-07-04 14:57:20 +02:00
parent f7b8094dfb
commit ab721dd3c1
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
10 changed files with 32 additions and 0 deletions

View file

@ -5356,6 +5356,14 @@ fn run_low_level<'a, 'ctx, 'env>(
let length = load_symbol(scope, &args[2]);
call_str_bitcode_fn(env, &[string, start, length], bitcode::STR_SUBSTRING_UNSAFE)
}
StrReserve => {
// Str.reserve : Str, Nat -> Str
debug_assert_eq!(args.len(), 2);
let string = load_symbol(scope, &args[0]);
let capacity = load_symbol(scope, &args[1]);
call_str_bitcode_fn(env, &[string, capacity], bitcode::STR_RESERVE)
}
StrTrim => {
// Str.trim : Str -> Str
debug_assert_eq!(args.len(), 1);