mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-12 14:23:33 +00:00
slice: fix examples
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user