It seems like a weird choice to me. Zig's standard library functions that require allocation take the allocator as a parameter, and return oom errors back up to the caller to do with as they please. Usually, the caller will also just kick that error up until it reaches the top of the call stack and gets caught by the default panic handler, but at any point they can choose to handle it however they want. Handling the error by kicking it up the call stack is a single keyword at the callsite.
As a bonus, this means that when you're reading code you can easily spot the function calls that have a possibility of failing.
As a bonus, this means that when you're reading code you can easily spot the function calls that have a possibility of failing.