update zig

This commit is contained in:
Mitchell Hashimoto
2022-05-17 12:05:56 -07:00
parent 94c9f73ec0
commit 5b47195e49
2 changed files with 8 additions and 8 deletions

6
flake.lock generated
View File

@ -92,11 +92,11 @@
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"
}, },
"locked": { "locked": {
"lastModified": 1651711478, "lastModified": 1652661822,
"narHash": "sha256-/TR7+JG7/hsiisAzJNm8Ppu9yzPQpSbAf/+9AZhSq7I=", "narHash": "sha256-sxcyWNay31B0qvBymGIX7lR9cXLHnNnNMV9PnykEChs=",
"owner": "roarkanize", "owner": "roarkanize",
"repo": "zig-overlay", "repo": "zig-overlay",
"rev": "0bb50cd99403e0bf17b3218e21388ac09999176c", "rev": "15ce9ff0c1f0a29d44a0f94ae3a96e39071ba8c4",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -30,7 +30,7 @@ const debug = std.debug;
const testing = std.testing; const testing = std.testing;
const Allocator = std.mem.Allocator; const Allocator = std.mem.Allocator;
const File = std.fs.File; const File = std.fs.File;
const BufMap = std.BufMap; const EnvMap = std.process.EnvMap;
/// Path to the command to run. This must be an absolute path. This /// Path to the command to run. This must be an absolute path. This
/// library does not do PATH lookup. /// library does not do PATH lookup.
@ -44,7 +44,7 @@ args: []const []const u8,
/// Environment variables for the child process. If this is null, inherits /// Environment variables for the child process. If this is null, inherits
/// the environment variables from this process. These are the exact /// the environment variables from this process. These are the exact
/// environment variables to set; these are /not/ merged. /// environment variables to set; these are /not/ merged.
env: ?*const BufMap = null, env: ?*const EnvMap = null,
/// The file handle to set for stdin/out/err. If this isn't set, we do /// The file handle to set for stdin/out/err. If this isn't set, we do
/// nothing explicitly so it is up to the behavior of the operating system. /// nothing explicitly so it is up to the behavior of the operating system.
@ -264,7 +264,7 @@ test "expandPath: slash" {
// Copied from Zig. This is a publicly exported function but there is no // Copied from Zig. This is a publicly exported function but there is no
// way to get it from the std package. // way to get it from the std package.
fn createNullDelimitedEnvMap(arena: mem.Allocator, env_map: *const std.BufMap) ![:null]?[*:0]u8 { fn createNullDelimitedEnvMap(arena: mem.Allocator, env_map: *const EnvMap) ![:null]?[*:0]u8 {
const envp_count = env_map.count(); const envp_count = env_map.count();
const envp_buf = try arena.allocSentinel(?[*:0]u8, envp_count, null); const envp_buf = try arena.allocSentinel(?[*:0]u8, envp_count, null);
@ -284,7 +284,7 @@ fn createNullDelimitedEnvMap(arena: mem.Allocator, env_map: *const std.BufMap) !
test "createNullDelimitedEnvMap" { test "createNullDelimitedEnvMap" {
const allocator = testing.allocator; const allocator = testing.allocator;
var envmap = BufMap.init(allocator); var envmap = EnvMap.init(allocator);
defer envmap.deinit(); defer envmap.deinit();
try envmap.put("HOME", "/home/ifreund"); try envmap.put("HOME", "/home/ifreund");
@ -378,7 +378,7 @@ test "Command: custom env vars" {
var stdout = try td.dir.createFile("stdout.txt", .{ .read = true }); var stdout = try td.dir.createFile("stdout.txt", .{ .read = true });
defer stdout.close(); defer stdout.close();
var env = std.BufMap.init(testing.allocator); var env = EnvMap.init(testing.allocator);
defer env.deinit(); defer env.deinit();
try env.put("VALUE", "hello"); try env.put("VALUE", "hello");