From 0f05aac290d22d04cbdf0d222199f8cc64010669 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Sat, 8 Mar 2025 12:17:55 -0500 Subject: [PATCH] LibCore: Mark the lambda in Promise::when_resolved as mutable This allows the handler passed into this function to also be mutable. --- Libraries/LibCore/Promise.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibCore/Promise.h b/Libraries/LibCore/Promise.h index 8db457e2d9b..add93c1c074 100644 --- a/Libraries/LibCore/Promise.h +++ b/Libraries/LibCore/Promise.h @@ -82,7 +82,7 @@ public: template F> Promise& when_resolved(F handler) { - return when_resolved([handler = move(handler)](Result& result) -> ErrorOr { + return when_resolved([handler = move(handler)](Result& result) mutable -> ErrorOr { handler(result); return {}; });