the.bay.news

Confusion with if and optionals

Ziggit
Confusion with if and optionals
I have this code: if (try entry.fields.fetchPut(config.field_name, new_value)) |old| { old.value.deinit(allocator); } and I get this error: src/cli/main.zig:876:22: error: expected type '*value.Value', found '*const value.Value' old.value.deinit(allocator); ~~~~~~~~~^~~~~~~ src/cli/main.zig:876:22: note: cast discards const qualifier src/core/value.zig:64:25: note: parameter type declared here pub fn deinit(self: *Self, allocator: std.mem.Allocator) void { But...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.