diff options
author | 2023-04-09 05:39:05 -0700 | |
---|---|---|
committer | 2023-04-09 05:39:05 -0700 | |
commit | 7bd6a1f86d99c1374cb1eb15ff263dc352a8837b (patch) | |
tree | 6b7646d6bf34ca83844f713b3be671dc71a40b37 /src/install | |
parent | 1e717dd941090b5c52f36445f3a53d41e1bc7894 (diff) | |
download | bun-7bd6a1f86d99c1374cb1eb15ff263dc352a8837b.tar.gz bun-7bd6a1f86d99c1374cb1eb15ff263dc352a8837b.tar.zst bun-7bd6a1f86d99c1374cb1eb15ff263dc352a8837b.zip |
Remove usages of `void{}` in favor of `{}`
See https://github.com/ziglang/zig/issues/15213
Diffstat (limited to 'src/install')
-rw-r--r-- | src/install/dependency.zig | 2 | ||||
-rw-r--r-- | src/install/extract_tarball.zig | 4 | ||||
-rw-r--r-- | src/install/install.zig | 32 | ||||
-rw-r--r-- | src/install/lockfile.zig | 2 |
4 files changed, 20 insertions, 20 deletions
diff --git a/src/install/dependency.zig b/src/install/dependency.zig index 8f02cc404..6af2e7754 100644 --- a/src/install/dependency.zig +++ b/src/install/dependency.zig @@ -64,7 +64,7 @@ pub fn isLessThan(string_buf: []const u8, lhs: Dependency, rhs: Dependency) bool const lhs_name = lhs.name.slice(string_buf); const rhs_name = rhs.name.slice(string_buf); - return strings.cmpStringsAsc(void{}, lhs_name, rhs_name); + return strings.cmpStringsAsc({}, lhs_name, rhs_name); } pub fn countWithDifferentBuffers(this: *const Dependency, name_buf: []const u8, version_buf: []const u8, comptime StringBuilder: type, builder: StringBuilder) void { diff --git a/src/install/extract_tarball.zig b/src/install/extract_tarball.zig index df2238535..2244230ab 100644 --- a/src/install/extract_tarball.zig +++ b/src/install/extract_tarball.zig @@ -259,7 +259,7 @@ fn extract(this: *const ExtractTarball, tgz_bytes: []const u8) !Install.ExtractD extract_destination, null, void, - void{}, + {}, // for npm packages, the root dir is always "package" 1, true, @@ -271,7 +271,7 @@ fn extract(this: *const ExtractTarball, tgz_bytes: []const u8) !Install.ExtractD extract_destination, null, void, - void{}, + {}, // for npm packages, the root dir is always "package" 1, true, diff --git a/src/install/install.zig b/src/install/install.zig index 0ae273f79..94a984416 100644 --- a/src/install/install.zig +++ b/src/install/install.zig @@ -1053,7 +1053,7 @@ const PackageInstall = struct { path, 0, )) { - 0 => void{}, + 0 => {}, else => |errno| switch (std.os.errno(errno)) { .OPNOTSUPP => return error.NotSupported, .NOENT => return error.FileNotFound, @@ -1087,7 +1087,7 @@ const PackageInstall = struct { }; return Result{ - .success = void{}, + .success = {}, }; } @@ -1111,7 +1111,7 @@ const PackageInstall = struct { this.destination_dir_subpath, 0, )) { - 0 => .{ .success = void{} }, + 0 => .{ .success = {} }, else => |errno| switch (std.os.errno(errno)) { .OPNOTSUPP => error.NotSupported, .NOENT => error.FileNotFound, @@ -1198,7 +1198,7 @@ const PackageInstall = struct { }; return Result{ - .success = void{}, + .success = {}, }; } @@ -1259,7 +1259,7 @@ const PackageInstall = struct { }; return Result{ - .success = void{}, + .success = {}, }; } @@ -1354,7 +1354,7 @@ const PackageInstall = struct { }; return Result{ - .success = void{}, + .success = {}, }; } @@ -1532,7 +1532,7 @@ const PackageInstall = struct { } if (supported_method_to_use != .copyfile) return Result{ - .success = void{}, + .success = {}, }; // TODO: linux io_uring @@ -6982,9 +6982,9 @@ pub const PackageManager = struct { &installer, .{ .onExtract = PackageInstaller.installEnqueuedPackages, - .onResolve = void{}, - .onPackageManifestError = void{}, - .onPackageDownloadError = void{}, + .onResolve = {}, + .onPackageManifestError = {}, + .onPackageDownloadError = {}, }, log_level, ); @@ -7001,9 +7001,9 @@ pub const PackageManager = struct { &installer, .{ .onExtract = PackageInstaller.installEnqueuedPackages, - .onResolve = void{}, - .onPackageManifestError = void{}, - .onPackageDownloadError = void{}, + .onResolve = {}, + .onPackageManifestError = {}, + .onPackageDownloadError = {}, }, log_level, ); @@ -7016,9 +7016,9 @@ pub const PackageManager = struct { &installer, .{ .onExtract = PackageInstaller.installEnqueuedPackages, - .onResolve = void{}, - .onPackageManifestError = void{}, - .onPackageDownloadError = void{}, + .onResolve = {}, + .onPackageManifestError = {}, + .onPackageDownloadError = {}, }, log_level, ); diff --git a/src/install/lockfile.zig b/src/install/lockfile.zig index 93cd15fb2..eab6ad9a3 100644 --- a/src/install/lockfile.zig +++ b/src/install/lockfile.zig @@ -2254,7 +2254,7 @@ pub const Package = extern struct { source: logger.Source, comptime features: Features, ) !void { - return package.parse(lockfile, allocator, log, source, void, void{}, features); + return package.parse(lockfile, allocator, log, source, void, {}, features); } pub fn parse( |