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
commit 0f05aac290
Notes: github-actions[bot] 2025-03-09 15:15:29 +00:00

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 {};
});