slice: fix examples

This commit is contained in:
Laytan Laats
2026-01-11 20:09:40 +01:00
parent f6b8e08628
commit 6c663b7a71

View File

@@ -300,7 +300,9 @@ Example:
import "core:slice"
import "core:fmt"
main :: proc() {
stable_sort_by_example :: proc() {
Example :: struct { n: int, s: string }
arr := []Example {
{2, "name"},
{3, "Bill"},
@@ -312,10 +314,9 @@ Example:
})
for e in arr do fmt.printf("%s ", e.s)
fmt.println()
}
Example :: struct { n: int, s: string }
Output:
My name is Bill
*/
@@ -335,7 +336,9 @@ Example:
import "core:slice"
import "core:fmt"
main :: proc() {
stable_sort_by_cmp_example :: proc() {
Example :: struct { n: int, s: string }
arr := []Example {
{2, "name"},
{3, "Bill"},
@@ -347,9 +350,9 @@ Example:
})
for e in arr do fmt.printf("%s ", e.s)
fmt.println()
}
Example :: struct { n: int, s: string }
Output:
My name is Bill
*/