diff options
author | 2021-12-30 21:12:32 -0800 | |
---|---|---|
committer | 2021-12-30 21:12:32 -0800 | |
commit | e75c711c68896f5952793601f156c921c814caab (patch) | |
tree | f3b30e2281c7231d480bb84503d17b2370866ff9 /misctools/fetch.zig | |
parent | 8d031f13c0e04629d431176e211a31224b7618c0 (diff) | |
download | bun-e75c711c68896f5952793601f156c921c814caab.tar.gz bun-e75c711c68896f5952793601f156c921c814caab.tar.zst bun-e75c711c68896f5952793601f156c921c814caab.zip |
Upgrade to latest Zig, remove dependency on patched version of Zig (#96)
* Prepare to upgrade zig
* zig fmt
* AllocGate
* Update data_url.zig
* wip
* few files
* just headers now?
* I think everything works?
* Update mimalloc
* Update hash_map.zig
* Perf improvements to compensate for Allocgate
* Bump
* :camera:
* Update bun.lockb
* Less branching
* [js parser] Slightly reduce memory usage
* Update js_parser.zig
* WIP remove unused
* [JS parser] WIP support for `with` keyword
* Remove more dead code
* Fix all the build errors!
* cleanup
* Move `network_thread` up
* Bump peechy
* Update README.md
Diffstat (limited to 'misctools/fetch.zig')
-rw-r--r-- | misctools/fetch.zig | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/misctools/fetch.zig b/misctools/fetch.zig index 776ac3950..7f6a68c45 100644 --- a/misctools/fetch.zig +++ b/misctools/fetch.zig @@ -1,9 +1,18 @@ const std = @import("std"); -usingnamespace @import("../src/global.zig"); +const _global = @import("../src/global.zig"); +const string = _global.string; +const Output = _global.Output; +const Global = _global.Global; +const Environment = _global.Environment; +const strings = _global.strings; +const MutableString = _global.MutableString; +const stringZ = _global.stringZ; +const default_allocator = _global.default_allocator; +const C = _global.C; const clap = @import("../src/deps/zig-clap/clap.zig"); const URL = @import("../src/query_string_map.zig").URL; -const Headers = @import("../src/javascript/jsc/webcore/response.zig").Headers; +const Headers = @import("http").Headers; const Method = @import("../src/http/method.zig").Method; const ColonListType = @import("../src/cli/colon_list_type.zig").ColonListType; const HeadersTuple = ColonListType(string, noop_resolver); @@ -62,7 +71,7 @@ pub const Arguments = struct { body: string = "", turbo: bool = false, - pub fn parse(allocator: *std.mem.Allocator) !Arguments { + pub fn parse(allocator: std.mem.Allocator) !Arguments { var diag = clap.Diagnostic{}; var args = clap.parse(clap.Help, ¶ms, .{ @@ -174,7 +183,7 @@ pub fn main() anyerror!void { var request_body_string = try default_allocator.create(MutableString); request_body_string.* = body_in_str; - try channel.buffer.ensureCapacity(1); + try channel.buffer.ensureTotalCapacity(1); try NetworkThread.init(); |