From 5d4cf2d9e155f1576f27399c68299f4dafa440d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Thu, 15 Feb 2024 17:26:47 +0100 Subject: [PATCH] Make formatAlloc inferred as safe. The version in vibe-d:utils infers as safe and various places rely on that. --- source/vibe/internal/string.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/vibe/internal/string.d b/source/vibe/internal/string.d index 9ec6ac5a..6e227dd2 100644 --- a/source/vibe/internal/string.d +++ b/source/vibe/internal/string.d @@ -185,8 +185,8 @@ ptrdiff_t matchBracket(string str, bool nested = true) string formatAlloc(ARGS...)(IAllocator alloc, string fmt, ARGS args) { auto app = AllocAppender!string(alloc); - formattedWrite(&app, fmt, args); - return app.data; + formattedWrite(() @trusted { return &app; } (), fmt, args); + return () @trusted { return app.data; } (); } /// Special version of icmp() with optimization for ASCII characters