git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commitdaeab10f640d0ff6ddc2b83093f3e5f7528ec1d6
parent664a49c678
authorIsaac Freund <[email protected]>
date2023-01-30 23:48
wlr-output-management: fix bug due to zig miscompilation

It looks like having the empty error capture |_| on the else branch of
the if statement causes the else branch to be ignored by the compiler.

This should be a compile error, as the condition of the if statement is
a bool, not an error union.

 river/Root.zig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/river/Root.zig b/river/Root.zig
index 1a18da4..6418203 100644
--- a/river/Root.zig
+++ b/river/Root.zig
@@ -468,7 +468,7 @@ fn processOutputConfig(
                         self.removeOutput(output);
                         self.output_layout.remove(output.wlr_output);
                     }
-                } else |_| {
+                } else {
                     std.log.scoped(.output_manager).err("failed to apply config to output {s}", .{
                         output.wlr_output.name,
                     });