use else in err switch

This commit is contained in:
Lee Cannon 2020-11-07 15:13:30 +00:00 committed by Jakub Konka
parent 32c998e03c
commit dbbe709dc7

View File

@ -2309,13 +2309,8 @@ pub fn chdir(dir_path: []const u8) ChangeCurDirError!void {
@compileError("chdir is not supported in WASI");
} else if (builtin.os.tag == .windows) {
windows.SetCurrentDirectory(dir_path) catch |err| switch (err) {
error.InvalidUtf8 => return error.InvalidUtf8,
error.NameTooLong => return error.NameTooLong,
error.FileNotFound => return error.FileNotFound,
error.NotDir => return error.NotDir,
error.NoDevice => return error.FileSystem,
error.AccessDenied => return error.AccessDenied,
error.Unexpected => return error.Unexpected,
else => |e| return e,
};
} else {
const dir_path_c = try toPosixPath(dir_path);