diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-06-24 16:58:19 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-24 16:58:19 -0700 |
| commit | 146b79af153bbd5dafda0ba12a040385c7fc58f8 (patch) | |
| tree | 67e3db8b444d65c667e314770fc983a7fc8ba293 /lib/std/http/Server.zig | |
| parent | 13853bef0df3c90633021850cc6d6abaeea03282 (diff) | |
| parent | 21ac0beb436f49fe49c6982a872f2dc48e4bea5e (diff) | |
| download | zig-146b79af153bbd5dafda0ba12a040385c7fc58f8.tar.gz zig-146b79af153bbd5dafda0ba12a040385c7fc58f8.zip | |
Merge pull request #16163 from mlugg/feat/builtins-infer-dest-ty
Infer destination type of cast builtins using result type
Diffstat (limited to 'lib/std/http/Server.zig')
| -rw-r--r-- | lib/std/http/Server.zig | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/std/http/Server.zig b/lib/std/http/Server.zig index fe57b5735d..8c8661ee21 100644 --- a/lib/std/http/Server.zig +++ b/lib/std/http/Server.zig @@ -46,7 +46,7 @@ pub const Connection = struct { const nread = try conn.rawReadAtLeast(conn.read_buf[0..], 1); if (nread == 0) return error.EndOfStream; conn.read_start = 0; - conn.read_end = @intCast(u16, nread); + conn.read_end = @as(u16, @intCast(nread)); } pub fn peek(conn: *Connection) []const u8 { @@ -67,8 +67,8 @@ pub const Connection = struct { if (available_read > available_buffer) { // partially read buffered data @memcpy(buffer[out_index..], conn.read_buf[conn.read_start..conn.read_end][0..available_buffer]); - out_index += @intCast(u16, available_buffer); - conn.read_start += @intCast(u16, available_buffer); + out_index += @as(u16, @intCast(available_buffer)); + conn.read_start += @as(u16, @intCast(available_buffer)); break; } else if (available_read > 0) { // fully read buffered data @@ -268,7 +268,7 @@ pub const Request = struct { } inline fn int64(array: *const [8]u8) u64 { - return @bitCast(u64, array.*); + return @as(u64, @bitCast(array.*)); } method: http.Method, @@ -493,7 +493,7 @@ pub const Response = struct { try res.connection.fill(); const nchecked = try res.request.parser.checkCompleteHead(res.allocator, res.connection.peek()); - res.connection.drop(@intCast(u16, nchecked)); + res.connection.drop(@as(u16, @intCast(nchecked))); if (res.request.parser.state.isContent()) break; } @@ -560,7 +560,7 @@ pub const Response = struct { try res.connection.fill(); const nchecked = try res.request.parser.checkCompleteHead(res.allocator, res.connection.peek()); - res.connection.drop(@intCast(u16, nchecked)); + res.connection.drop(@as(u16, @intCast(nchecked))); } if (has_trail) { |
