In this code, I want out_path to be assigned the value of path if path.len != 0, otherwise it should be null. However, the current approach doesn’t work.
Also in general can I do something like this:
const out = {
...
...
return 5; // assign to `out`
};
Compared to Rust, where blocks implicitly return the last value, in Zig, you need to use break with a label to return a value from a block. Relevant language reference section.