fix str_to_utf8

This commit is contained in:
Folkert 2022-02-20 01:10:09 +01:00
parent 2c4d0e71a6
commit 1c0d092c48
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
4 changed files with 27 additions and 30 deletions

View file

@ -228,8 +228,7 @@ pub const RocStr = extern struct {
}
pub fn isEmpty(self: RocStr) bool {
const empty_len = RocStr.empty().str_len;
return self.str_len == empty_len;
return self.len() == 0;
}
// If a string happens to be null-terminated already, then we can pass its