mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
Str.reserve
This commit is contained in:
parent
f7b8094dfb
commit
ab721dd3c1
10 changed files with 32 additions and 0 deletions
|
@ -83,6 +83,7 @@ pub fn builtin_defs_map(symbol: Symbol, var_store: &mut VarStore) -> Option<Def>
|
|||
STR_COUNT_GRAPHEMES => str_count_graphemes,
|
||||
STR_COUNT_UTF8_BYTES => str_count_bytes,
|
||||
STR_SUBSTRING_UNSAFE => str_substring_unsafe,
|
||||
STR_RESERVE => str_reserve,
|
||||
STR_FROM_UTF8 => str_from_utf8,
|
||||
STR_FROM_UTF8_RANGE => str_from_utf8_range,
|
||||
STR_TO_UTF8 => str_to_utf8,
|
||||
|
@ -1737,6 +1738,11 @@ fn str_substring_unsafe(symbol: Symbol, var_store: &mut VarStore) -> Def {
|
|||
lowlevel_3(symbol, LowLevel::StrSubstringUnsafe, var_store)
|
||||
}
|
||||
|
||||
/// Str.reserve : Str, Nat -> Str
|
||||
fn str_reserve(symbol: Symbol, var_store: &mut VarStore) -> Def {
|
||||
lowlevel_2(symbol, LowLevel::StrReserve, var_store)
|
||||
}
|
||||
|
||||
/// Str.fromUtf8 : List U8 -> Result Str [BadUtf8 { byteIndex : Nat, problem : Utf8Problem } }]*
|
||||
fn str_from_utf8(symbol: Symbol, var_store: &mut VarStore) -> Def {
|
||||
let bytes_var = var_store.fresh();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue