diff options
Diffstat (limited to 'src/cli/create_command.zig')
-rw-r--r-- | src/cli/create_command.zig | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/src/cli/create_command.zig b/src/cli/create_command.zig index ee6266f40..27531e4ad 100644 --- a/src/cli/create_command.zig +++ b/src/cli/create_command.zig @@ -1845,8 +1845,6 @@ pub const Example = struct { var mutable = try ctx.allocator.create(MutableString); mutable.* = try MutableString.init(ctx.allocator, 8096); - var request_body = try MutableString.init(ctx.allocator, 0); - // ensure very stable memory address var async_http: *HTTP.AsyncHTTP = ctx.allocator.create(HTTP.AsyncHTTP) catch unreachable; async_http.* = HTTP.AsyncHTTP.initSync( @@ -1856,7 +1854,7 @@ pub const Example = struct { header_entries, headers_buf, mutable, - &request_body, + "", 60 * std.time.ns_per_min, ); async_http.client.progress_node = progress; @@ -1916,12 +1914,20 @@ pub const Example = struct { var mutable = try ctx.allocator.create(MutableString); mutable.* = try MutableString.init(ctx.allocator, 2048); - var request_body = try MutableString.init(ctx.allocator, 0); url = URL.parse(try std.fmt.bufPrint(&url_buf, "https://registry.npmjs.org/@bun-examples/{s}/latest", .{name})); // ensure very stable memory address var async_http: *HTTP.AsyncHTTP = ctx.allocator.create(HTTP.AsyncHTTP) catch unreachable; - async_http.* = HTTP.AsyncHTTP.initSync(ctx.allocator, .GET, url, .{}, "", mutable, &request_body, 60 * std.time.ns_per_min); + async_http.* = HTTP.AsyncHTTP.initSync( + ctx.allocator, + .GET, + url, + .{}, + "", + mutable, + "", + 60 * std.time.ns_per_min, + ); async_http.client.progress_node = progress; var response = try async_http.sendSync(true); @@ -1993,7 +1999,16 @@ pub const Example = struct { mutable.reset(); // ensure very stable memory address - async_http.* = HTTP.AsyncHTTP.initSync(ctx.allocator, .GET, URL.parse(tarball_url), .{}, "", mutable, &request_body, 60 * std.time.ns_per_min); + async_http.* = HTTP.AsyncHTTP.initSync( + ctx.allocator, + .GET, + URL.parse(tarball_url), + .{}, + "", + mutable, + "", + 60 * std.time.ns_per_min, + ); async_http.client.progress_node = progress; refresher.maybeRefresh(); @@ -2018,7 +2033,6 @@ pub const Example = struct { url = URL.parse(examples_url); var async_http: *HTTP.AsyncHTTP = ctx.allocator.create(HTTP.AsyncHTTP) catch unreachable; - var request_body = try MutableString.init(ctx.allocator, 0); var mutable = try ctx.allocator.create(MutableString); mutable.* = try MutableString.init(ctx.allocator, 2048); @@ -2029,7 +2043,7 @@ pub const Example = struct { .{}, "", mutable, - &request_body, + "", 60 * std.time.ns_per_min, ); |