Closed Ruulul closed 6 months ago
Hi @Ruulul, thanks for the PR. Believe it or not, j2d.end
and j3d.end
used to be void functions. I don't quite remember why I changed them, maybe some errors were too important to be ignored at the time. Anyway, both functions have been refactored many times after then, I think it's ok to simply make them void functions again.
Using
defer
on pairs of setup and cleanup is a common zig idiom, but since theend()
functions can error, its impossible right now.Suggested refactor:
try
expressions to catch, save the error and return;begin()
try theend
error as the first thing;so it would be something like
Gonna write down a PR, just thought it would be good to open an issue first.