srctree

Gregory Mullen parent e4d4a8da 7737fc4f
sort gift to the top as well

inlinesplit
src/main.zig added: 10, removed: 2, total 8
@@ -70,10 +70,18 @@ fn isVideo(str: []const u8) bool {
return std.mem.endsWith(u8, str, ".mp4");
}
 
fn isGif(str: []const u8) bool {
return std.mem.endsWith(u8, str, ".gif");
}
 
fn cmpStrVideo(_: void, lhs: []const u8, rhs: []const u8) bool {
return if (isVideo(lhs) and !isVideo(rhs))
true
else if (isVideo(rhs))
else if (!isVideo(lhs) and isVideo(rhs))
false
else if (isGif(lhs) and !isGif(rhs))
true
else if (!isGif(lhs) and isGif(rhs))
false
else
cmpStr({}, lhs, rhs);