add specifications for fromUtf8 and toUtf8

This commit is contained in:
Folkert 2021-10-03 13:22:03 +02:00
parent 018348bd83
commit 486f1d540f
3 changed files with 24 additions and 3 deletions

View file

@ -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()) {