mirror of
https://codeberg.org/ziglings/exercises.git
synced 2025-06-08 01:57:02 +09:00
Replace var
s with const
s in async exercises
This commit is contained in:
parent
140c22e9f4
commit
7ab6692ebd
3 changed files with 4 additions and 4 deletions
|
@ -36,7 +36,7 @@ const print = @import("std").debug.print;
|
|||
pub fn main() void {
|
||||
var myframe = async getPageTitle("http://example.com");
|
||||
|
||||
var value = ???
|
||||
const value = ???
|
||||
|
||||
print("{s}\n", .{value});
|
||||
}
|
||||
|
|
|
@ -41,8 +41,8 @@ pub fn main() void {
|
|||
var com_frame = async getPageTitle("http://example.com");
|
||||
var org_frame = async getPageTitle("http://example.org");
|
||||
|
||||
var com_title = com_frame;
|
||||
var org_title = org_frame;
|
||||
const com_title = com_frame;
|
||||
const org_title = org_frame;
|
||||
|
||||
print(".com: {s}, .org: {s}.\n", .{ com_title, org_title });
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ pub fn main() void {
|
|||
// The main() function can not be async. But we know
|
||||
// getBeef() will not suspend with this particular
|
||||
// invocation. Please make this okay:
|
||||
var my_beef = getBeef(0);
|
||||
const my_beef = getBeef(0);
|
||||
|
||||
print("beef? {X}!\n", .{my_beef});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue