Zig's @constCast

from blog openmymind.net, | ↗ original
In the Coding in Zig section of my Learning Zig series, an invalid snippet was recently pointed out to me. The relevant part was: if (try stdin.readUntilDelimiterOrEof(&buf, '\n')) |line| { var name = line; if (builtin.os.tag == .windows) { name = std.mem.trimRight(u8, name, "\r"); } if (name.len == 0) { break; } try...