Skip to content

Commit

Permalink
Fix code for windows 08-coding_in_zig.html
Browse files Browse the repository at this point in the history
Fix error: expected type '[]u8', found '[]const u8' in std.mem.trimRight call
  • Loading branch information
rofrol authored Aug 8, 2024
1 parent 96ff5b6 commit e78928c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/08-coding_in_zig.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ pub fn main() !void {
if (builtin.os.tag == .windows) {
// W systemie Windows linie są zakończone znakiem \r\n.
// Musimy usunąć \r
name = std.mem.trimRight(u8, name, "\r");
name = @constCast(std.mem.trimRight(u8, name, "\r"));
}
if (name.len == 0) {
break;
Expand Down Expand Up @@ -249,7 +249,7 @@ pub fn main() !void {
if (builtin.os.tag == .windows) {
// W systemie Windows linie są zakończone znakiem \r\n.
// Musimy usunąć \r
name = std.mem.trimRight(u8, name, "\r");
name = @constCast(std.mem.trimRight(u8, name, "\r"));
}
if (name.len == 0) {
break;
Expand Down

0 comments on commit e78928c

Please sign in to comment.