diff --git a/src/rpp/rpp/operators/debounce.hpp b/src/rpp/rpp/operators/debounce.hpp index 8ea753fef..d589d951a 100644 --- a/src/rpp/rpp/operators/debounce.hpp +++ b/src/rpp/rpp/operators/debounce.hpp @@ -79,7 +79,7 @@ class debounce_disposable final : public rpp::composite_disposable_impl& handler) -> schedulers::optional_delay_from_now { auto value_or_duration = handler.disposable->extract_value_or_time(); if (auto* duration = std::get_if(&value_or_duration)) - return *duration; + return schedulers::optional_delay_from_now{*duration}; if (auto* value = std::get_if(&value_or_duration)) handler.disposable->get_observer_under_lock()->on_next(std::move(*value)); diff --git a/src/rppqt/rppqt/schedulers/main_thread.hpp b/src/rppqt/rppqt/schedulers/main_thread.hpp index 1355ddd0e..2b339d9f7 100644 --- a/src/rppqt/rppqt/schedulers/main_thread.hpp +++ b/src/rppqt/rppqt/schedulers/main_thread.hpp @@ -41,7 +41,7 @@ class main_thread_scheduler final QTimer::singleShot(std::chrono::duration_cast(duration), application, [fn = std::forward(fn), handler = std::forward(handler), ... args = std::forward(args)]() mutable { if (const auto new_duration = fn(handler, args...)) - defer_for(new_duration.value(), std::move(fn), std::move(handler), std::move(args)...); + defer_for(new_duration->value, std::move(fn), std::move(handler), std::move(args)...); }); }