aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Ciro Spaciari <ciro.spaciari@gmail.com> 2023-08-02 16:58:44 -0300
committerGravatar GitHub <noreply@github.com> 2023-08-02 12:58:44 -0700
commitd9f162ff954ffe46403b40dee3844568498799aa (patch)
tree0f4407bd293d49a7f990ca2ded6b98bdc0eca58a
parent9bbac35fd072d90cf77daf2dd085898145a57d62 (diff)
downloadbun-d9f162ff954ffe46403b40dee3844568498799aa.tar.gz
bun-d9f162ff954ffe46403b40dee3844568498799aa.tar.zst
bun-d9f162ff954ffe46403b40dee3844568498799aa.zip
clean declare structs (#3929)
-rw-r--r--src/bun.js/api/server.zig3
-rw-r--r--src/http_client_async.zig4
2 files changed, 2 insertions, 5 deletions
diff --git a/src/bun.js/api/server.zig b/src/bun.js/api/server.zig
index 10afa4ac1..195d2a3f3 100644
--- a/src/bun.js/api/server.zig
+++ b/src/bun.js/api/server.zig
@@ -169,8 +169,7 @@ pub const ServerConfig = struct {
const log = Output.scoped(.SSLConfig, false);
pub fn asUSockets(this_: ?SSLConfig) uws.us_bun_socket_context_options_t {
- var ctx_opts: uws.us_bun_socket_context_options_t = undefined;
- @memset(@as([*]u8, @ptrCast(&ctx_opts))[0..@sizeOf(uws.us_bun_socket_context_options_t)], 0);
+ var ctx_opts: uws.us_bun_socket_context_options_t = .{};
if (this_) |ssl_config| {
if (ssl_config.key_file_name != null)
diff --git a/src/http_client_async.zig b/src/http_client_async.zig
index d49f7814d..4998cec85 100644
--- a/src/http_client_async.zig
+++ b/src/http_client_async.zig
@@ -319,9 +319,7 @@ fn NewHTTPContext(comptime ssl: bool) type {
}
pub fn init(this: *@This()) !void {
- var opts: uws.us_socket_context_options_t = undefined;
- const size = @sizeOf(uws.us_socket_context_options_t);
- @memset(@as([*]u8, @ptrCast(&opts))[0..size], 0);
+ var opts: uws.us_socket_context_options_t = .{};
this.us_socket_context = uws.us_create_socket_context(ssl_int, http_thread.loop, @sizeOf(usize), opts).?;
if (comptime ssl) {
this.sslCtx().setup();