Skip to content

Commit

Permalink
Make formatAlloc inferred as safe.
Browse files Browse the repository at this point in the history
The version in vibe-d:utils infers as safe and various places rely on that.
  • Loading branch information
s-ludwig committed Feb 15, 2024
1 parent 230faa5 commit 5d4cf2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/vibe/internal/string.d
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5d4cf2d

Please sign in to comment.