add equality for strings

This commit is contained in:
Folkert 2021-01-02 18:50:29 +01:00
parent 3e1d6d0965
commit 2ac19fb6e3
7 changed files with 84 additions and 20 deletions

View file

@ -260,6 +260,11 @@ pub const RocStr = extern struct {
}
};
// Str.equal
pub fn strEqual(self: RocStr, other: RocStr) callconv(.C) bool {
return self.eq(other);
}
// Str.numberOfBytes
pub fn strNumberOfBytes(string: RocStr) callconv(.C) usize {
return string.len();