tmp: work towards making README.md example compile

This commit is contained in:
Rekai Nyangadzayi Musuka 2023-04-18 01:06:22 -05:00
parent a61caad235
commit 61a105c7c0
2 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ As an example:
```zig ```zig
const std = @import("std"); const std = @import("std");
const expectEqual = std.testing.expectEqual; const expectEqual = std.testing.expectEqual;
const HashArrayMappedTrie = @import("hamt"); const HashArrayMappedTrie = @import("hamt").HashArrayMappedTrie ;
const StringTrie = HashArrayMappedTrie([]const u8, void, StringContext); const StringTrie = HashArrayMappedTrie([]const u8, void, StringContext);

View File

@ -21,7 +21,7 @@ pub fn HashArrayMappedTrie(comptime K: type, comptime V: type, comptime Context:
const Node = union(enum) { kv: Pair, table: Table }; const Node = union(enum) { kv: Pair, table: Table };
const Table = struct { map: Digest = 0, base: [*]Node }; const Table = struct { map: Digest = 0, base: [*]Node };
const Pair = struct { key: K, value: V }; pub const Pair = struct { key: K, value: V };
pub fn init() Self { pub fn init() Self {
return Self{ .root = [_]?*Node{null} ** table_size }; return Self{ .root = [_]?*Node{null} ** table_size };