mirror of
https://github.com/ziglang/zig.git
synced 2026-02-14 13:30:45 +00:00
Fix example code in comments for asc and desc
This commit is contained in:
parent
be6ac82ee1
commit
50af87a9e3
@ -1129,7 +1129,7 @@ fn swap(
|
||||
}
|
||||
}
|
||||
|
||||
/// Use to generate a comparator function for a given type. e.g. `sort(u8, slice, asc(u8))`.
|
||||
/// Use to generate a comparator function for a given type. e.g. `sort(u8, slice, {}, comptime asc(u8))`.
|
||||
pub fn asc(comptime T: type) fn (void, T, T) bool {
|
||||
const impl = struct {
|
||||
fn inner(context: void, a: T, b: T) bool {
|
||||
@ -1140,7 +1140,7 @@ pub fn asc(comptime T: type) fn (void, T, T) bool {
|
||||
return impl.inner;
|
||||
}
|
||||
|
||||
/// Use to generate a comparator function for a given type. e.g. `sort(u8, slice, asc(u8))`.
|
||||
/// Use to generate a comparator function for a given type. e.g. `sort(u8, slice, {}, comptime desc(u8))`.
|
||||
pub fn desc(comptime T: type) fn (void, T, T) bool {
|
||||
const impl = struct {
|
||||
fn inner(context: void, a: T, b: T) bool {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user