diff options
| author | gingerBill <bill@gingerbill.org> | 2024-01-28 15:48:19 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2024-01-28 15:48:19 +0000 |
| commit | 30636f5114d3379664ad3acdf0862ad9486033dd (patch) | |
| tree | 3e185f3632713aa1afbf3663dad8f1e3d1edfde6 | |
| parent | da6edb3764b735a839acdd375328574833d782c1 (diff) | |
Change return values from `Struct_Tag` to `string`
| -rw-r--r-- | core/reflect/reflect.odin | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/reflect/reflect.odin b/core/reflect/reflect.odin index 24a826f04..a70ec5b86 100644 --- a/core/reflect/reflect.odin +++ b/core/reflect/reflect.odin @@ -513,13 +513,13 @@ struct_fields_zipped :: proc(T: typeid) -> (fields: #soa[]Struct_Field) { @(require_results) -struct_tag_get :: proc(tag: Struct_Tag, key: string) -> (value: Struct_Tag) { - value, _ = struct_tag_lookup(tag, key) - return +struct_tag_get :: proc(tag: Struct_Tag, key: string) -> (value: string) { + v, _ := struct_tag_lookup(tag, key) + return string(v) } @(require_results) -struct_tag_lookup :: proc(tag: Struct_Tag, key: string) -> (value: Struct_Tag, ok: bool) { +struct_tag_lookup :: proc(tag: Struct_Tag, key: string) -> (value: string, ok: bool) { for t := tag; t != ""; /**/ { i := 0 for i < len(t) && t[i] == ' ' { // Skip whitespace @@ -570,7 +570,7 @@ struct_tag_lookup :: proc(tag: Struct_Tag, key: string) -> (value: Struct_Tag, o t = t[i+1:] if key == name { - return Struct_Tag(val[1:i]), true + return val[1:i], true } } return |