Skip to content

Commit

Permalink
remove async integration (#44)
Browse files Browse the repository at this point in the history
The async mode has been removed in ziglang/zig#18712
  • Loading branch information
Techatrix authored Feb 11, 2024
1 parent 806ba01 commit 2aa7f2e
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions known-folders.zig
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,7 @@ fn getPathXdg(allocator: std.mem.Allocator, arena: *std.heap.ArenaAllocator, fol
if (!folder_spec.env.user_dir) break :env_opt null;

// TODO: add caching so we only need to read once in a run
const config_dir_path = if (std.io.is_async) blk: {
var frame = arena.allocator().create(@Frame(getPathXdg)) catch break :env_opt null;
_ = @asyncCall(frame, {}, getPathXdg, .{ arena.allocator(), arena, .local_configuration });
break :blk (await frame) catch null orelse break :env_opt null;
} else blk: {
break :blk getPathXdg(arena.allocator(), arena, .local_configuration) catch null orelse break :env_opt null;
};

const config_dir_path = getPathXdg(arena.allocator(), arena, .local_configuration) catch null orelse break :env_opt null;
const config_dir = std.fs.cwd().openDir(config_dir_path, .{}) catch break :env_opt null;
const home = std.process.getEnvVarOwned(arena.allocator(), "HOME") catch null orelse break :env_opt null;
const user_dirs = config_dir.openFile("user-dirs.dirs", .{}) catch null orelse break :env_opt null;
Expand Down

0 comments on commit 2aa7f2e

Please sign in to comment.