Skip to content

Commit 6da2954

Browse files
committed
upgrade to zig 0.13
1 parent 9524522 commit 6da2954

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
zig-cache
2+
/.zig-cache/
23
zig-out
34
/vendor/netsurf/build/
45
/vendor/netsurf/lib/

src/async/Client.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ pub const Connection = struct {
278278
if (conn.read_end != conn.read_start) return;
279279

280280
var iovecs = [1]std.posix.iovec{
281-
.{ .iov_base = &conn.read_buf, .iov_len = conn.read_buf.len },
281+
.{ .base = &conn.read_buf, .len = conn.read_buf.len },
282282
};
283283
const nread = try conn.readvDirect(&iovecs);
284284
if (nread == 0) return error.EndOfStream;
@@ -314,8 +314,8 @@ pub const Connection = struct {
314314
}
315315

316316
var iovecs = [2]std.posix.iovec{
317-
.{ .iov_base = buffer.ptr, .iov_len = buffer.len },
318-
.{ .iov_base = &conn.read_buf, .iov_len = conn.read_buf.len },
317+
.{ .base = buffer.ptr, .len = buffer.len },
318+
.{ .base = &conn.read_buf, .len = conn.read_buf.len },
319319
};
320320
const nread = try conn.readvDirect(&iovecs);
321321

@@ -1560,7 +1560,7 @@ pub const RequestOptions = struct {
15601560
};
15611561

15621562
fn validateUri(uri: Uri, arena: Allocator) !struct { Connection.Protocol, Uri } {
1563-
const protocol_map = std.ComptimeStringMap(Connection.Protocol, .{
1563+
const protocol_map = std.StaticStringMap(Connection.Protocol).initComptime(.{
15641564
.{ "http", .plain },
15651565
.{ "ws", .plain },
15661566
.{ "https", .tls },

src/async/stream.zig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ pub const Stream = struct {
107107
/// See equivalent function: `std.fs.File.writev`.
108108
pub fn writev(self: Stream, iovecs: []const posix.iovec_const) WriteError!usize {
109109
if (iovecs.len == 0) return 0;
110-
const first_buffer = iovecs[0].iov_base[0..iovecs[0].iov_len];
110+
const first_buffer = iovecs[0].base[0..iovecs[0].len];
111111
return try self.write(first_buffer);
112112
}
113113

@@ -121,13 +121,13 @@ pub const Stream = struct {
121121
var i: usize = 0;
122122
while (true) {
123123
var amt = try self.writev(iovecs[i..]);
124-
while (amt >= iovecs[i].iov_len) {
125-
amt -= iovecs[i].iov_len;
124+
while (amt >= iovecs[i].len) {
125+
amt -= iovecs[i].len;
126126
i += 1;
127127
if (i >= iovecs.len) return;
128128
}
129-
iovecs[i].iov_base += amt;
130-
iovecs[i].iov_len -= amt;
129+
iovecs[i].base += amt;
130+
iovecs[i].len -= amt;
131131
}
132132
}
133133
};

src/main_wpt.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ fn runSafe(
288288
argv.appendAssumeCapacity(tc);
289289
defer _ = argv.pop();
290290

291-
const run = try std.ChildProcess.run(.{
291+
const run = try std.process.Child.run(.{
292292
.allocator = alloc,
293293
.argv = argv.items,
294294
.max_output_bytes = 1024 * 1024,

0 commit comments

Comments
 (0)