p1 and p2 are both assumed to be the kind provided.
fn compareDiskDesignators(comptime T: type, kind: DiskDesignatorKind, p1: []const T, p2: []const T) bool
fn compareDiskDesignators(comptime T: type, kind: DiskDesignatorKind, p1: []const T, p2: []const T) bool {
const eql = switch (T) {
u8 => eqlIgnoreCaseWtf8,
u16 => eqlIgnoreCaseWtf16,
else => @compileError("only u8 (WTF-8) and u16 (WTF-16LE) is supported"),
};
switch (kind) {
.drive => {
const drive_letter1 = getDriveLetter(T, p1);
const drive_letter2 = getDriveLetter(T, p2);
return eql(drive_letter1, drive_letter2);
},
.unc => {
const unc1 = parseUNC(T, p1);
const unc2 = parseUNC(T, p2);
return eql(unc1.server, unc2.server) and
eql(unc1.share, unc2.share);
},
}
}