aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Rijn <Kelimion@users.noreply.github.com>2026-02-12 10:48:26 +0100
committerJeroen van Rijn <Kelimion@users.noreply.github.com>2026-02-12 10:48:26 +0100
commit97683ae0146e6668d56e701c1d54a4e1737e41c8 (patch)
tree9762dbd861da8df49e390dd8908dae840ea44334
parentb18f75c41c4a78c1e368908ee0bfbba8efa1c494 (diff)
Simplify
-rw-r--r--core/os/path.odin4
-rw-r--r--tests/core/os/file.odin7
2 files changed, 5 insertions, 6 deletions
diff --git a/core/os/path.odin b/core/os/path.odin
index e0353e43d..3c22852bf 100644
--- a/core/os/path.odin
+++ b/core/os/path.odin
@@ -145,7 +145,7 @@ This will remove duplicate separators and unneeded references to the current or
parent directory.
*/
@(require_results)
-clean_path :: proc(path: string, allocator: runtime.Allocator) -> (cleaned: string, err: Error) {
+clean_path :: proc(path: string, allocator: runtime.Allocator) -> (cleaned: string, err: runtime.Allocator_Error) {
if path == "" || path == "." {
return strings.clone(".", allocator)
}
@@ -491,7 +491,7 @@ Join all `elems` with the system's path separator and normalize the result.
For example, `join_path({"/home", "foo", "bar.txt"})` will result in `"/home/foo/bar.txt"`.
*/
@(require_results)
-join_path :: proc(elems: []string, allocator: runtime.Allocator) -> (joined: string, err: Error) {
+join_path :: proc(elems: []string, allocator: runtime.Allocator) -> (joined: string, err: runtime.Allocator_Error) {
for e, i in elems {
if e != "" {
temp_allocator := TEMP_ALLOCATOR_GUARD({ allocator })
diff --git a/tests/core/os/file.odin b/tests/core/os/file.odin
index aed57c26c..99ae5b928 100644
--- a/tests/core/os/file.odin
+++ b/tests/core/os/file.odin
@@ -5,10 +5,9 @@ import "core:testing"
@(test)
test_clone :: proc(t: ^testing.T) {
- joined, err := os.join_path({#directory, "file.odin"}, context.temp_allocator)
- testing.expect_value(t, err, nil)
- f: ^os.File
- f, err = os.open(joined)
+ joined, j_err := os.join_path({#directory, "file.odin"}, context.temp_allocator)
+ testing.expect_value(t, j_err, nil)
+ f, err := os.open(joined)
testing.expect_value(t, err, nil)
testing.expect(t, f != nil)