tmp: work towards making README.md example compile
This commit is contained in:
parent
a61caad235
commit
61a105c7c0
|
@ -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);
|
||||||
|
|
||||||
|
|
|
@ -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 };
|
||||||
|
|
Loading…
Reference in New Issue