Browse Source

Make strings.to_cstring adhere to #optional_allocator_error

Jeroen van Rijn 3 months ago
parent
commit
39789bc6cb
1 changed files with 1 additions and 1 deletions
  1. 1 1
      core/strings/builder.odin

+ 1 - 1
core/strings/builder.odin

@@ -311,7 +311,7 @@ Returns:
 - res: A cstring of the Builder's buffer upon success
 - res: A cstring of the Builder's buffer upon success
 - err: An optional allocator error if one occured, `nil` otherwise
 - err: An optional allocator error if one occured, `nil` otherwise
 */
 */
-to_cstring :: proc(b: ^Builder) -> (res: cstring, err: mem.Allocator_Error) {
+to_cstring :: proc(b: ^Builder) -> (res: cstring, err: mem.Allocator_Error) #optional_allocator_error {
 	n := append(&b.buf, 0) or_return
 	n := append(&b.buf, 0) or_return
 	if n != 1 {
 	if n != 1 {
 		return nil, .Out_Of_Memory
 		return nil, .Out_Of_Memory