Wiring up dictionary and hash rust code to their zig counterparts

This commit is contained in:
Chadtech 2021-01-18 15:25:37 -05:00
parent c7f6de2afe
commit 520dcfbaca
13 changed files with 79 additions and 10 deletions

View file

@ -2,7 +2,7 @@ const std = @import("std");
const testing = std.testing;
const expectEqual = testing.expectEqual;
const RocDict = struct {
pub const RocDict = extern struct {
size: usize,
pub fn init() RocDict {
@ -16,7 +16,8 @@ const RocDict = struct {
}
};
pub fn dictSize(dict: RocDict) usize {
// Dict.size
pub fn dictSize(dict: RocDict) callconv(.C) usize {
return dict.size;
}