File tree Expand file tree Collapse file tree 4 files changed +10
-7
lines changed
Expand file tree Collapse file tree 4 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 11.{
2- .name = " maxminddb" ,
2+ .name = . maxminddb ,
33 .version = "0.0.0" ,
4+ .fingerprint = 0x9ea10897ba27121c ,
45 .paths = .{
56 "build.zig" ,
67 "build.zig.zon" ,
Original file line number Diff line number Diff line change @@ -164,11 +164,11 @@ pub const Decoder = struct {
164164 // We support Structs or Optional Structs only to safely decode arrays and hashmaps.
165165 comptime var DecodedType : type = T ;
166166 switch (@typeInfo (DecodedType )) {
167- .Struct = > {},
168- .Optional = > | opt | {
167+ .@"struct" = > {},
168+ .optional = > | opt | {
169169 DecodedType = opt .child ;
170170 switch (@typeInfo (DecodedType )) {
171- .Struct = > {},
171+ .@"struct" = > {},
172172 else = > {
173173 std .debug .print ("expected field {any} got optional {any}\n " , .{ field , DecodedType });
174174 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 {
55 // see https://github.com/ziglang/zig/pull/21083.
66
77 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 );
910 const src = try std .posix .mmap (
1011 null ,
1112 aligned_file_size ,
@@ -19,6 +20,7 @@ pub fn map(f: std.fs.File) ![]u8 {
1920}
2021
2122pub 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 );
2325 std .posix .munmap (@alignCast (src .ptr [0.. aligned_src_len ]));
2426}
Original file line number Diff line number Diff line change @@ -324,7 +324,7 @@ fn Iterator(comptime T: type) type {
324324 };
325325
326326 pub fn next (self : * Self ) ! ? Item {
327- while (self .stack .popOrNull ()) | current | {
327+ while (self .stack .pop ()) | current | {
328328 const reader = self .reader ;
329329 const bit_count = current .ip_bytes .bitCount ();
330330
You can’t perform that action at this time.
0 commit comments