Update stdlib with new syntax for short function decl.

This commit is contained in:
Christoffer Lerno
2025-02-08 23:04:59 +01:00
parent c4f9efc8f5
commit e1d546225f
16 changed files with 335 additions and 417 deletions

View File

@@ -29,12 +29,9 @@ enum PathEnv
POSIX
}
fn Path! new_cwd(Allocator allocator = allocator::heap())
fn Path! new_cwd(Allocator allocator = allocator::heap()) => @pool(allocator)
{
@pool(allocator)
{
return new(os::getcwd(allocator::temp()), allocator);
};
return new(os::getcwd(allocator::temp()), allocator);
}
fn Path! getcwd(Allocator allocator = allocator::heap()) @deprecated("Use new_cwd()")
@@ -164,12 +161,9 @@ fn Path! temp_new(String path, PathEnv path_env = DEFAULT_PATH_ENV)
return new(path, allocator::temp(), path_env);
}
fn Path! new_win32_wstring(WString path, Allocator allocator = allocator::heap())
fn Path! new_win32_wstring(WString path, Allocator allocator = allocator::heap()) => @pool(allocator)
{
@pool(allocator)
{
return path::new(string::temp_from_wstring(path)!, allocator: allocator);
};
return path::new(string::temp_from_wstring(path)!, allocator: allocator);
}
fn Path! new_windows(String path, Allocator allocator = allocator::heap())