mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
add specifications for fromUtf8 and toUtf8
This commit is contained in:
parent
018348bd83
commit
486f1d540f
3 changed files with 24 additions and 3 deletions
|
@ -1148,10 +1148,10 @@ test "RocStr.joinWith: result is big" {
|
|||
|
||||
// Str.toUtf8
|
||||
pub fn strToUtf8C(arg: RocStr) callconv(.C) RocList {
|
||||
return @call(.{ .modifier = always_inline }, strToBytes, .{arg});
|
||||
return strToBytes(arg);
|
||||
}
|
||||
|
||||
fn strToBytes(arg: RocStr) RocList {
|
||||
inline fn strToBytes(arg: RocStr) RocList {
|
||||
if (arg.isEmpty()) {
|
||||
return RocList.empty();
|
||||
} else if (arg.isSmallStr()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue