From 020b14722208c55d0cf1d3999166ae31f1f71df4 Mon Sep 17 00:00:00 2001 From: oskarnp Date: Sun, 26 Mar 2023 21:33:27 +0200 Subject: [PATCH] Move helper procs into utility.odin --- core/text/table/table.odin | 8 -------- core/text/table/utility.odin | 13 +++++++++++++ 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 core/text/table/utility.odin diff --git a/core/text/table/table.odin b/core/text/table/table.odin index c15a92bae..bd72455aa 100644 --- a/core/text/table/table.odin +++ b/core/text/table/table.odin @@ -389,11 +389,3 @@ write_text_align :: proc(w: io.Writer, colw, lpad, rpad: int, text: string, alig } write_byte_repeat(w, rpad, ' ') } - -stdio_writer :: proc() -> io.Writer { - return io.to_writer(os.stream_from_handle(os.stdout)) -} - -strings_builder_writer :: proc(b: ^strings.Builder) -> io.Writer { - return strings.to_writer(b) -} diff --git a/core/text/table/utility.odin b/core/text/table/utility.odin new file mode 100644 index 000000000..0e56fd968 --- /dev/null +++ b/core/text/table/utility.odin @@ -0,0 +1,13 @@ +package text_table + +import "core:io" +import "core:os" +import "core:strings" + +stdio_writer :: proc() -> io.Writer { + return io.to_writer(os.stream_from_handle(os.stdout)) +} + +strings_builder_writer :: proc(b: ^strings.Builder) -> io.Writer { + return strings.to_writer(b) +}