3 ms·
Both the Zig standard library as well as several third party projects do check errors like this. I already commented on Zig compiler/stdlib code itself, but he
by dminik 1y ago
Both the Zig standard library as well as several third party projects do check errors like this.
I already commented on Zig compiler/stdlib code itself, but here's Tigerbeetle and Bun, the two biggest(?) Zig codebases:
https://github.com/search?q=repo%3Atigerbeetle%2Ftigerbeetle%20%22%3D%3D%20error.%22&type=code https://github.com/search?q=repo%3Atigerbeetle%2Ftigerbeetle...
https://github.com/search?q=repo%3Aoven-sh%2Fbun%20%22%3D%3D%20error.%22&type=code https://github.com/search?q=repo%3Aoven-sh%2Fbun%20%22%3D%3D...
- dminik 1y agoOk, while it's cool that the TigerBeetle link now shows no matches (down from two) the comment now feels wrong. Anyways, you guys left in the `!= error.` checks, so here's some snapshots that hopefully won't be invalidated :P https://github.com/tigerbeetle/tigerbeetle/blob/b173fdc8270016e8c29da06640c726523e8acb90/src/vsr/multi_batch.zig#L490 https://github.com/tigerbeetle/tigerbeetle/blob/b173fdc82700... https://github.com/tigerbeetle/tigerbeetle/blob/b173fdc8270016e8c29da06640c726523e8acb90/src/state_machine_fuzz.zig#L104 https://github.com/tigerbeetle/tigerbeetle/blob/b173fdc82700... (different file, same check.)
- matklad 1y agoGood catch of != thanks!