File tree 4 files changed +10
-7
lines changed 4 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 1
1
.{
2
- .name = " maxminddb" ,
2
+ .name = . maxminddb ,
3
3
.version = "0.0.0" ,
4
+ .fingerprint = 0x9ea10897ba27121c ,
4
5
.paths = .{
5
6
"build.zig" ,
6
7
"build.zig.zon" ,
Original file line number Diff line number Diff line change @@ -164,11 +164,11 @@ pub const Decoder = struct {
164
164
// We support Structs or Optional Structs only to safely decode arrays and hashmaps.
165
165
comptime var DecodedType : type = T ;
166
166
switch (@typeInfo (DecodedType )) {
167
- .Struct = > {},
168
- .Optional = > | opt | {
167
+ .@"struct" = > {},
168
+ .optional = > | opt | {
169
169
DecodedType = opt .child ;
170
170
switch (@typeInfo (DecodedType )) {
171
- .Struct = > {},
171
+ .@"struct" = > {},
172
172
else = > {
173
173
std .debug .print ("expected field {any} got optional {any}\n " , .{ field , DecodedType });
174
174
return DecodeError .UnsupportedFieldType ;
Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ pub fn map(f: std.fs.File) ![]u8 {
5
5
// see https://github.com/ziglang/zig/pull/21083.
6
6
7
7
const file_size = (try f .stat ()).size ;
8
- const aligned_file_size = std .mem .alignForward (usize , file_size , std .mem .page_size );
8
+ const page_size = std .heap .pageSize ();
9
+ const aligned_file_size = std .mem .alignForward (usize , file_size , page_size );
9
10
const src = try std .posix .mmap (
10
11
null ,
11
12
aligned_file_size ,
@@ -19,6 +20,7 @@ pub fn map(f: std.fs.File) ![]u8 {
19
20
}
20
21
21
22
pub fn unmap (src : []u8 ) void {
22
- const aligned_src_len = std .mem .alignForward (usize , src .len , std .mem .page_size );
23
+ const page_size = std .heap .pageSize ();
24
+ const aligned_src_len = std .mem .alignForward (usize , src .len , page_size );
23
25
std .posix .munmap (@alignCast (src .ptr [0.. aligned_src_len ]));
24
26
}
Original file line number Diff line number Diff line change @@ -324,7 +324,7 @@ fn Iterator(comptime T: type) type {
324
324
};
325
325
326
326
pub fn next (self : * Self ) ! ? Item {
327
- while (self .stack .popOrNull ()) | current | {
327
+ while (self .stack .pop ()) | current | {
328
328
const reader = self .reader ;
329
329
const bit_count = current .ip_bytes .bitCount ();
330
330
You can’t perform that action at this time.
0 commit comments