diff --git a/std/event/future.zig b/std/event/future.zig index f9b9db86a..8abdce7d0 100644 --- a/std/event/future.zig +++ b/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(); diff --git a/std/event/group.zig b/std/event/group.zig index 493913010..6c7fc6369 100644 --- a/std/event/group.zig +++ b/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 diff --git a/std/event/lock.zig b/std/event/lock.zig index 2769a2153..c4cb1a3f0 100644 --- a/std/event/lock.zig +++ b/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{ diff --git a/std/event/tcp.zig b/std/event/tcp.zig index 9a3c6f95c..ea803a932 100644 --- a/std/event/tcp.zig +++ b/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 {