Commit 96a94e7da9
Changed files (4)
std
std/event/future.zig
@@ -101,8 +101,7 @@ test "std.event.Future" {
async fn testFuture(loop: *Loop) void {
suspend {
- var h: promise = @handle();
- resume h;
+ resume @handle();
}
var future = Future(i32).init(loop);
@@ -117,16 +116,14 @@ async fn testFuture(loop: *Loop) void {
async fn waitOnFuture(future: *Future(i32)) i32 {
suspend {
- var h: promise = @handle();
- resume h;
+ resume @handle();
}
return (await (async future.get() catch @panic("memory"))).*;
}
async fn resolveFuture(future: *Future(i32)) void {
suspend {
- var h: promise = @handle();
- resume h;
+ resume @handle();
}
future.data = 6;
future.resolve();
std/event/group.zig
@@ -57,8 +57,7 @@ pub fn Group(comptime ReturnType: type) type {
suspend {
var my_node: Stack.Node = undefined;
node.* = &my_node;
- var h: promise = @handle();
- resume h;
+ resume @handle();
}
// TODO this allocation elision should be guaranteed because we await it in
std/event/lock.zig
@@ -142,8 +142,7 @@ test "std.event.Lock" {
async fn testLock(loop: *Loop, lock: *Lock) void {
// TODO explicitly put next tick node memory in the coroutine frame #1194
suspend {
- var h: promise = @handle();
- resume h;
+ resume @handle();
}
const handle1 = async lockRunner(lock) catch @panic("out of memory");
var tick_node1 = Loop.NextTickNode{
std/event/tcp.zig
@@ -142,8 +142,7 @@ test "listen on a port, send bytes, receive bytes" {
std.debug.panic("unable to handle connection: {}\n", err);
};
suspend {
- var h: promise = @handle();
- cancel h;
+ cancel @handle();
}
}
async fn errorableHandler(self: *Self, _addr: *const std.net.Address, _socket: *const std.os.File) !void {