From 6c663b7a71ddd1288b92cd47eb6876e96cb3ab34 Mon Sep 17 00:00:00 2001 From: Laytan Laats Date: Sun, 11 Jan 2026 20:09:40 +0100 Subject: [PATCH] slice: fix examples --- core/slice/sort.odin | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/core/slice/sort.odin b/core/slice/sort.odin index d438cfc1b..9f91a0f73 100644 --- a/core/slice/sort.odin +++ b/core/slice/sort.odin @@ -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 */