1
0
Fork 0
mirror of https://codeberg.org/ziglings/exercises.git synced 2025-06-08 10:07:01 +09:00

Replace vars with consts in async exercises

This commit is contained in:
Aurora 2024-07-05 14:22:06 +10:00
parent 140c22e9f4
commit 7ab6692ebd
3 changed files with 4 additions and 4 deletions

View file

@ -36,7 +36,7 @@ const print = @import("std").debug.print;
pub fn main() void { pub fn main() void {
var myframe = async getPageTitle("http://example.com"); var myframe = async getPageTitle("http://example.com");
var value = ??? const value = ???
print("{s}\n", .{value}); print("{s}\n", .{value});
} }

View file

@ -41,8 +41,8 @@ pub fn main() void {
var com_frame = async getPageTitle("http://example.com"); var com_frame = async getPageTitle("http://example.com");
var org_frame = async getPageTitle("http://example.org"); var org_frame = async getPageTitle("http://example.org");
var com_title = com_frame; const com_title = com_frame;
var org_title = org_frame; const org_title = org_frame;
print(".com: {s}, .org: {s}.\n", .{ com_title, org_title }); print(".com: {s}, .org: {s}.\n", .{ com_title, org_title });
} }

View file

@ -29,7 +29,7 @@ pub fn main() void {
// The main() function can not be async. But we know // The main() function can not be async. But we know
// getBeef() will not suspend with this particular // getBeef() will not suspend with this particular
// invocation. Please make this okay: // invocation. Please make this okay:
var my_beef = getBeef(0); const my_beef = getBeef(0);
print("beef? {X}!\n", .{my_beef}); print("beef? {X}!\n", .{my_beef});
} }