authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-07-05 13:25:37 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-07-05 13:25:37 -07:00
loga16a0441443899b8ebc14a6693b5262512c65168
treec19f592df7b4a7a364f76bd01337f9709dda4e0a
parentf7122c1dce069c5cc08288c0b066ebdac0d9a4aa

sort moved to std.mem


1 files changed, 2 insertions(+), 2 deletions(-)

src/lib.zig+2-2
......@@ -218,7 +218,7 @@ pub fn ptrCastConst(comptime T: type, ptr: *const anyopaque) *const T {
218218}
219219
220220pub fn sortBy(comptime T: type, items: []T, comptime field: std.meta.FieldEnum(T)) void {
221 std.sort.sort(T, items, {}, struct {
221 std.mem.sort(T, items, {}, struct {
222222 fn f(_: void, lhs: T, rhs: T) bool {
223223 return @field(lhs, @tagName(field)) < @field(rhs, @tagName(field));
224224 }
......@@ -226,7 +226,7 @@ pub fn sortBy(comptime T: type, items: []T, comptime field: std.meta.FieldEnum(T
226226}
227227
228228pub fn sortBySlice(comptime T: type, items: []T, comptime field: std.meta.FieldEnum(T)) void {
229 std.sort.sort(T, items, {}, struct {
229 std.mem.sort(T, items, {}, struct {
230230 fn f(_: void, lhs: T, rhs: T) bool {
231231 return lessThanSlice(std.meta.FieldType(T, field))({}, @field(lhs, @tagName(field)), @field(rhs, @tagName(field)));
232232 }