Remove the redundant check and directly use `dir()`

pull/3458/head
Bryan Lee 2025-01-03 00:21:44 +08:00
parent 9f44ec7c21
commit 6fca26972b
No known key found for this signature in database
GPG Key ID: AA996124D88BE937
1 changed files with 0 additions and 7 deletions

View File

@ -30,13 +30,6 @@ pub fn config(alloc: Allocator, opts: Options) ![]u8 {
/// Get the XDG cache directory. The returned value is allocated.
pub fn cache(alloc: Allocator, opts: Options) ![]u8 {
if (posix.getenv("XDG_CACHE_HOME")) |env| {
return try std.fs.path.join(alloc, &[_][]const u8{
env,
opts.subdir orelse "",
});
}
return try dir(alloc, opts, .{
.env = "XDG_CACHE_HOME",
.windows_env = "LOCALAPPDATA",