path is assumed to be drive-relative or drive-absolute.
fn getDriveLetter(comptime T: type, path: []const T) []const T
fn getDriveLetter(comptime T: type, path: []const T) []const T {
const len: usize = switch (T) {
// getWin32PathType will only return .drive_absolute/.drive_relative when there is
// (1) a valid code point, and (2) a code point < U+10000, so we only need to
// get the length determined by the first byte.
u8 => std.unicode.utf8ByteSequenceLength(path[0]) catch unreachable,
u16 => 1,
else => @compileError("unsupported type: " ++ @typeName(T)),
};
return path[0..len];
}