From 33de527628a1862cf8d6f8b94cffed4ceed7c901 Mon Sep 17 00:00:00 2001 From: Amber Ehrlich Date: Tue, 15 Aug 2023 17:05:10 -0400 Subject: [PATCH] welp --- include/dpp/cluster.h | 2 +- src/dpp/cluster/timer.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/dpp/cluster.h b/include/dpp/cluster.h index cc4465bd59..352a200f54 100644 --- a/include/dpp/cluster.h +++ b/include/dpp/cluster.h @@ -363,7 +363,7 @@ class DPP_EXPORT cluster { * @param seconds How long to wait for * @return awaitable Object that can be co_await-ed to suspend the function for a certain time */ - awaitable co_sleep(uint64_t seconds); + [[nodiscard]] awaitable co_sleep(uint64_t seconds); #endif /** diff --git a/src/dpp/cluster/timer.cpp b/src/dpp/cluster/timer.cpp index 3f92d61e52..af767fff5a 100644 --- a/src/dpp/cluster/timer.cpp +++ b/src/dpp/cluster/timer.cpp @@ -106,8 +106,8 @@ void cluster::tick_timers() { #ifdef DPP_CORO awaitable cluster::co_sleep(uint64_t seconds) { - return {[this, seconds] (auto &&cb) { - start_timer([this, cb](dpp::timer handle) { + return awaitable{[this, seconds] (auto &&cb) mutable { + start_timer([this, cb] (dpp::timer handle) { cb(handle); stop_timer(handle); }, seconds);