LibCore: Mark the lambda in Promise::when_resolved as mutable

This allows the handler passed into this function to also be mutable.
This commit is contained in:
Timothy Flynn 2025-03-08 12:17:55 -05:00 committed by Tim Flynn
parent 8f6169859d
commit 0f05aac290

View File

@ -82,7 +82,7 @@ public:
template<CallableAs<void, Result&> F>
Promise& when_resolved(F handler)
{
return when_resolved([handler = move(handler)](Result& result) -> ErrorOr<void> {
return when_resolved([handler = move(handler)](Result& result) mutable -> ErrorOr<void> {
handler(result);
return {};
});